-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
automated method to install multiple packages? #3
Comments
To install Package Control, http://sublime.wbond.net/Package%20Control.sublime-package needs to be placed inside of the Installed Packages/ folder. The next time Sublime starts, it will install the package. To batch install other packages, a Package Control.sublime-settings file needs to be placed into the Packages/User/ folder. Inside of the settings file should be a JSON object with the key "installed_packages" that references a list of package names. When Package Control starts, if any of those packages are not present, the will be automatically downloaded and installed. Here is an example: http://pastebin.com/NLEavL1K. |
Magic. Exactly what I needed to hear. :) Thanks Will! Your contributions are incredible. |
@wbond, that is awesome! Perhaps I'll create that file here so people can bulk install all these packages. @paulirish Could the Package Control.sublime-package file & other custom settings files be installed by running one install script? And @wbond Could Package Control & this install script be installed with one command & then you restart Sublime? |
It would be fairly trivial to write a bash script that utilizes wget/curl to perform the download and install on OS X and Linux. I'm sure there is some way to do the same on Windows with WSH, there is just the slight added complexity that the Windows versions of Sublime can be portable, so there isn't always a definitive place for the config folder. |
I've got a Puppet manifest to install the dev (or beta) and then, after the program has been run for the first time (and the base packages have been installed/directories created), it will go on to install whatever other packages you specify.
|
@paulirish @wbond, it would be nice to have a oneliner like @mrmartineau suggested, but to be executed not from the editor, from command line. As you can see in the snippet below, I use curl to download package_control on Linux and cp to paste my package list, but after that I have to open, wait and close Sublime Text 2 manually several times for it complete. I don't think I can open sublime text 2 just to execute a script and close with a command. ST2=~/.config/sublime-text-2
mkdir -p $ST2/{Installed\ Packages,Packages/User}
curl http://sublime.wbond.net/Package%20Control.sublime-package \
> $ST2/Installed\ Packages/Package\ Control.sublime-package
cp $DOTFILES/st2/* $ST2/Packages/User
# Open Sublime Text and wait a bunch of minutes for package_control to install
# itself and all packages (several errors and manual restarts are expected) |
@mmacedo I have wrote a little gist to make this process little easier: |
Thanks @mmacedo. I will link to your post in the wiki |
@mrmartineau @mmacedo @paulirish @wbond. Go figure... I've been working on automating the sublime install+config. I started with a shell script then changed to python. A network admin buddy of mine is learning python so I decided to rewrite it as a python application and make it cross-platform so he can see the python-equivalent of a bash script. Note: I haven't implemented the Windows portion yet but it should work in both Linux and OSX. Since there's interest here, I migrated the code into its own repository @ https://github.com/evanplaice/sublime-text-seed. The
|
And in Powershell 5: $packageControl = "http://sublime.wbond.net/Package%20Control.sublime-package"
$sublimeConfig = "$env:APPDATA\Sublime Text 3"
$packagesRoot = "$sublimeConfig\Installed Packages"
$userPackages = "$sublimeConfig\Packages\User"
Invoke-WebRequest $packageControl -OutFile "$packagesRoot\Package Control.sublime-package"
$packagesToInstall = @{
installed_packages = @(
"SFTP",
"Git"
)
}
ConvertTo-Json $packagesToInstall | Out-File "$userPackages\Package Control.sublime-settings" -Encoding ASCII |
building on @evanplaice code .. i have also included automatic sublime projects creation in https://github.com/ahmadassaf/sublime-text-bootstrap |
@ahmadassaf @evanplaice The code you have is extremely insecure in terms of installing Package Control:
Modern versions of Sublime Text include a command to install Package Control securely. If you want to automate things, just call that command (look in the Default.sublime-commands for the command name). |
Thanks a lot @wbond for this info. I have just updated the link to the one i noticed in the latest instructions |
@wbond Thanks for the heads-up. The package control setup has been updated to use the more secure source link. Using the command pallet would be great but this tool is intended to be used as a complete unattended setup. AFAIK, it's not possible to launch commands in sublime directly from the CLI. @ahmadassaf Nice work. When I get the chance I'll have to review the changes you made in detail, I could probably learn a few things from the improvements you made. |
I love this sort of list; really nice job putting it together.
Once Package Control is in place, is there a nice way to bulk install all these packages? I ask because I'm putting together a larger framework and I'd like the install script to be able to set up the SublimeText packages on its own.
So ideally, you run my install script (let's assume its a shell script on os x, windows):
Is this at all possible?
ping @wbond as he's the expert here.
The text was updated successfully, but these errors were encountered: