Home Download Buy Blog Forum Support

How Do .sublime-package Files Work?

How Do .sublime-package Files Work?

Postby wbond on Tue Jul 26, 2011 3:01 pm

I am working on bundling up a package and I'd like to provide a nice easy-to-use solution for installing. I've read about .sublime-package files in relation to ST1. I've also found they still exist for ST2. I've, of course, found the Pristine Packages directory in the user's config directory. What I can't figure out how to do is use a .sublime-package file to install a package.

From playing around with the .sublime-package files that come with ST2, and from reading about them in relation to ST1, they appear to just be zip files. I've tried opening them with ST2 on Windows, Linux and OS X and on all platforms ST2 just opens it like a source code file.

I also tried placing my own .sublime-package file in the user's Pristine Packages folder, and it just gets deleted on ST2 startup. I was hoping it would extract the file into the packages directory. The only suspect element from startup is "PackageSetup returned: -1", but that seems to be printed even if my .sublime-package file is not present in Pristine Packages.

Is the ability to use .sublime-package files just not implemented yet, or am I missing something? Thanks for your help!
wbond
 
Posts: 527
Joined: Mon Feb 28, 2011 5:33 am

Re: How Do .sublime-package Files Work?

Postby guillermooo on Tue Jul 26, 2011 3:22 pm

In the S1 days, there would be a file type association made with .sublime-package files, so that by double-clicking on them, they'd be copied to the Installed Packages directory under the Data directory, and their contents uncompressed into Packages/<PackageName>.

This is no longer true for S2; .sublime-package remains an unknown file type for the OS, so these files don't exhibit any particular behavior. If you manually copy them to Installed Packages, however, S2 will do the unpacking as above the next time you start the editor.
guillermooo
 
Posts: 728
Joined: Thu Jul 23, 2009 9:06 am

Re: How Do .sublime-package Files Work?

Postby wbond on Tue Jul 26, 2011 3:28 pm

Hmm, so creating a directory called "Installed Packages" and copying the file there did the trick. It would be great if ST2 created this folder so there was one less step for users to install packages.

Thanks for the help!
wbond
 
Posts: 527
Joined: Mon Feb 28, 2011 5:33 am

Re: How Do .sublime-package Files Work?

Postby saivert on Tue Jul 26, 2011 9:25 pm

Also you should be able to drag and drop the package archive onto any Sublime text window to install it.
saivert
 
Posts: 6
Joined: Tue Jul 26, 2011 5:37 pm

Re: How Do .sublime-package Files Work?

Postby wbond on Wed Jul 27, 2011 1:07 am

Yeah, I would not mind if ST2 would install a package if you open the file through any of the standard mechanisms.
wbond
 
Posts: 527
Joined: Mon Feb 28, 2011 5:33 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 6 guests