Sublime Forum

How Do .sublime-package Files Work?

#1

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!

1 Like

#2

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/.

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.

0 Likes

#3

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!

0 Likes

#4

Also you should be able to drag and drop the package archive onto any Sublime text window to install it.

0 Likes

#5

Yeah, I would not mind if ST2 would install a package if you open the file through any of the standard mechanisms.

0 Likes