Created
July 13, 2012 14:04
-
-
Save justinspradlin/3105057 to your computer and use it in GitHub Desktop.
Create Symlinks for Sublime Text 2 Syncing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM This script should delete any settings for your local | |
REM installation of Sublime Text 2. It will then create | |
REM sym-links that point to your Dropbox folder | |
SET dropboxSettingDir=%USERPROFILE%\Dropbox\Apps\Sublime Text 2\ | |
SET sublimePluginDir=%APPDATA%\Sublime Text 2\ | |
echo Local Settings Dir: %sublimePluginDir% | |
echo Dropbox dir: %dropboxSettingDir% | |
REM Parse the command line args | |
IF "%1"=="" GOTO Usage | |
IF "%1"=="-i" GOTO InitialSetup | |
IF "%1"=="-s" GOTO SecondarySetup | |
REM All other cases go to usage statement | |
GOTO Usage | |
:Usage | |
echo. | |
echo -i Initial computer, this will move the Sublime Text plugins | |
echo to your Dropbox directory and create the proper sym-links | |
echo. | |
echo -s Secondary computer, this will remove your local settings and | |
echo add a sym-link to your dropbox folder | |
GOTO :EOF | |
:InitialSetup | |
echo Making the dropbox plugins dir %dropboxSettingDir% | |
mkdir "%dropboxSettingDir%" | |
echo Moving the plugins to your new drop box folder %sublimePluginDir% | |
move "%sublimePluginDir%Installed Packages" "%dropboxSettingDir%Installed Packages" | |
move "%sublimePluginDir%Packages" "%dropboxSettingDir%Packages" | |
move "%sublimePluginDir%Pristine Packages" "%dropboxSettingDir%Pristine Packages" | |
GOTO CreateSymlinks | |
:SecondarySetup | |
echo Creating the Sublime setting folder | |
mkdir "%sublimePluginDir%" | |
REM We need to delete any of the folders if they already exist | |
REM under the directory for Sublime Text. We will | |
REM replace these with a symlink to Dropbox. | |
RD /S "%sublimePluginDir%Installed Packages" | |
RD /S "%sublimePluginDir%Packages" | |
RD /S "%sublimePluginDir%Pristine Packages" | |
GOTO CreateSymlinks | |
:CreateSymlinks | |
echo Changing directory to %sublimePluginDir% to build symlinks | |
cd "%sublimePluginDir%" | |
echo Creating Symlinks for Sublime Text 2 syncing | |
mklink /D "Installed Packages" "%dropboxSettingDir%Installed Packages" | |
mklink /D "Packages" "%dropboxSettingDir%Packages" | |
mklink /D "Pristine Packages" "%dropboxSettingDir%Pristine Packages" | |
GOTO End | |
:End | |
echo Done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment