Permalink
Browse files

fix shell scripts

  • Loading branch information...
1 parent 8ce1faa commit 23c2a4703a825078ed73a60ea4389abca28600c0 @darwin darwin committed Nov 22, 2012
Showing with 36 additions and 7 deletions.
  1. +7 −0 bin/commit.sh
  2. +7 −1 bin/compile.sh
  3. +8 −4 bin/dev.sh
  4. +7 −1 bin/restart.sh
  5. +7 −1 bin/sync.sh
View
7 bin/commit.sh
@@ -1,4 +1,9 @@
#!/bin/bash
+
+pushd . > /dev/null
+cd "$(dirname "$0")"
+cd ..
+
echo "Committing last changes..."
echo "Note you maybe have to manually add new files you changed ('git add mynewfile.ext')"
@@ -12,3 +17,5 @@ if [[ $REPLY =~ ^[Yy]$ ]]; then
git push
echo "Pushed!"
fi
+
+popd > /dev/null
View
8 bin/compile.sh
@@ -1,4 +1,10 @@
#!/bin/bash
+pushd . > /dev/null
+cd "$(dirname "$0")"
+cd ..
+
# xib -> nib
-for xib in `ls -d plugin/*.xib`; do echo "Compiling $xib ..."; ibtool --errors --warnings --notices --output-format human-readable-text --compile "`echo $xib | cut -d'.' -f1`.nib" "$xib"; done
+for xib in `ls -d plugin/*.xib`; do echo "Compiling $xib ..."; ibtool --errors --warnings --notices --output-format human-readable-text --compile "`echo $xib | cut -d'.' -f1`.nib" "$xib"; done
+
+popd > /dev/null
View
12 bin/dev.sh
@@ -3,22 +3,26 @@ TOTALFINDER_RESOURCES='/Library/ScriptingAdditions/TotalFinder.osax/Contents/Res
TOTALFINDER_RESOURCES_BACKUP='/Library/ScriptingAdditions/TotalFinder.osax/Contents/Resources/TotalFinder.bundle/Contents/ResourcesOrig'
# need absolute path of the repo's root
-dir=`dirname $0`
-pushd "$dir" > /dev/null
+pushd . > /dev/null
+cd "$(dirname "$0")"
+cd ..
ROOT=$PWD
-popd > /dev/null
if [ ! -d "$TOTALFINDER_RESOURCES" ]; then # is it a folder?
echo "Please install TotalFinder. Folder '$TOTALFINDER_RESOURCES' not found".
+ popd > /dev/null
exit
fi
if [ -L "$TOTALFINDER_RESOURCES" ]; then # is is a symlink?
echo "TotalFinder is already in dev mode. Folder '$TOTALFINDER_RESOURCES' is a symlink! Exiting.".
+ popd > /dev/null
exit
fi
# ok, we should be safe to do the replacement
sudo mv "$TOTALFINDER_RESOURCES" "$TOTALFINDER_RESOURCES_BACKUP"
sudo ln -s "$ROOT/plugin" "$TOTALFINDER_RESOURCES"
-sudo cp "$TOTALFINDER_RESOURCES_BACKUP/"*.nib "$TOTALFINDER_RESOURCES" # steal compiled nibs from production
+sudo cp "$TOTALFINDER_RESOURCES_BACKUP/"*.nib "$TOTALFINDER_RESOURCES" # steal compiled nibs from production
+
+popd > /dev/null
View
8 bin/restart.sh
@@ -1,5 +1,9 @@
#!/bin/bash
+pushd . > /dev/null
+cd "$(dirname "$0")"
+cd ..
+
# quit Finder
osascript -e "tell application \"Finder\" to quit"
@@ -11,4 +15,6 @@ killall -SIGINT TotalFinderCrashWatcher
# ./compile.sh
# start TotalFinder agan
-open /Applications/TotalFinder.app
+open /Applications/TotalFinder.app
+
+popd > /dev/null
View
8 bin/sync.sh
@@ -1,5 +1,9 @@
#!/bin/bash
+pushd . > /dev/null
+cd "$(dirname "$0")"
+cd ..
+
echo "This may end in conflict, see git docs."
#point to server
@@ -20,4 +24,6 @@ echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
git push
echo "Pushed!"
-fi
+fi
+
+popd > /dev/null

0 comments on commit 23c2a47

Please sign in to comment.