Skip to content

Instantly share code, notes, and snippets.

@bitless
Last active December 21, 2015 14:49
Show Gist options
  • Save bitless/6322290 to your computer and use it in GitHub Desktop.
Save bitless/6322290 to your computer and use it in GitHub Desktop.
blunt plugin switching for sublime text 2
#!/bin/bash
## defaulting to the present concern, a save_on_modified script, from
## http://stackoverflow.com/questions/18234377/sublime-text-plugin-installing-and-using
if test -z "$1"
then
exit 1 ## "action required"
else
ACTION=$1
fi
if test -z "$2"
then
SCRIPT="save_on_modified.py"
else
SCRIPT=$2
fi
ST2AS="$HOME/Library/Application Support/Sublime Text 2"
PATH_ON="$ST2AS/Packages/User"
PATH_OFF="$ST2AS/Packages_User_Disabled"
if [ ! -d "$PATH_OFF" ]
then
mkdir "$PATH_OFF"
fi
if [ $ACTION != 'enable' ]
then
# if is not 'enable' we assume is 'disable'
mv "$PATH_ON/$SCRIPT" "$PATH_OFF/$SCRIPT"
else
mv "$PATH_OFF/$SCRIPT" "$PATH_ON/$SCRIPT"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment