Skip to content

Instantly share code, notes, and snippets.

@xpol
Last active December 20, 2015 15:29
Show Gist options
  • Save xpol/6154867 to your computer and use it in GitHub Desktop.
Save xpol/6154867 to your computer and use it in GitHub Desktop.
Packing script for Sublime Text 3 Markdown Preview plugin on windows.
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))
@xpol
Copy link
Author

xpol commented Aug 5, 2013

Packing script Sublime Text 3 Markdown Preview plugin on windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment