Last active
December 20, 2015 15:29
-
-
Save xpol/6154867 to your computer and use it in GitHub Desktop.
Packing script for Sublime Text 3 Markdown Preview plugin on windows.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function parent_directory_name(p) | |
if not p:find('[/\\]') then return '' end | |
return p:match('^.-([^/\\]+)[/\\][^/\\]+$') | |
end | |
local PKG = parent_directory_name(arg[0]) | |
print(PKG) | |
local installd = os.getenv('APPDATA') | |
local filename = string.format('%s\\Sublime Text 3\\Installed Packages\\%s.sublime-package', installd, PKG) | |
local command = '7z a -tzip -mx=9 "%s" . -xr!.* -xr!pack.lua -xr!.git' | |
print(filename..'...') | |
os.remove('*.sublime-package.tmp') | |
os.execute(command:format(filename)) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Packing script Sublime Text 3 Markdown Preview plugin on windows.