Home Download Buy Blog Forum Support

Structure repo how I want & distribute via Package Control?

Structure repo how I want & distribute via Package Control?

Postby JMM on Sat Feb 11, 2012 7:37 pm

I just developed a Sublime Text plugin / package (Cycle Setting) for the first time, pushed it to github, then looked at the Package Control developer instructions. Is there any [easy] way to structure my repo the way I want (not necessarily putting all package files in the root / putting files in the root that I don't want in the installed package) and still distribute via Package Control?

I'm thinking I'd like to be able to have files in a repo that are related to a package or its development without them actually being installed on users' machines with the package.

If I understand correctly, it looks like it would be possible to zip it up with a .sublime-package extension and point to that from a repository JSON file. But, that would be extra work / steps. Is there any way to structure the repo how I want and just point Package Control to a github URL? I haven't been able to find a way to request a zip of a subtree of a branch from github, so I'm guessing Package Control wouldn't be able to do this without taking an additional path argument and either downloading each file individually or downloading the zip of the whole branch and then extracting the subtree from it. But maybe there's a solution I haven't thought of.
JMM
 
Posts: 9
Joined: Fri Feb 03, 2012 1:23 pm
Location: Portsmouth NH

Re: Structure repo how I want & distribute via Package Control?

Postby wbond on Fri Feb 17, 2012 1:23 pm

You could always maintain a separate branch that was the distribution code and do your development in master. Some developers maintain a package.json file that points to a branch or tags on GitHub, if only for the sake of semantic versioning.
wbond
 
Posts: 528
Joined: Mon Feb 28, 2011 5:33 am

Re: Structure repo how I want & distribute via Package Control?

Postby JMM on Fri Feb 24, 2012 1:49 pm

Thanks for the reply and suggestion. I was looking into using a separate branch, but I wanted to make sure it was necessary before going through the hassle. Here's the workflow I'm trying now:

Original repo layout:

Code: Select all
Repo Root
   README
   ...
   Packages
      Package Name
         ...



One time:

* Create empty branch, package-control (as here)


Each time:

Code: Select all
$ git checkout package-control

$ # read-tree saves a bit of the hassle of shuffling files around

$ git read-tree -mu master:"Packages/Package Name"

$ # repeat checkout for other files as necessary)

$ git checkout master -- README

$ git commit



wbond wrote:Some developers maintain a package.json file that points to a branch or tags on GitHub, if only for the sake of semantic versioning.


Right, but that's not necessary just to point to a branch or tag -- that can be done from the main repositories.json file, correct? I already believe that's the case, but if it is, I don't want other people to get confused when they read this thread.
JMM
 
Posts: 9
Joined: Fri Feb 03, 2012 1:23 pm
Location: Portsmouth NH


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 10 guests