Skip to content

Instantly share code, notes, and snippets.

@robertwalker
Created October 12, 2010 00:17
Show Gist options
  • Save robertwalker/621450 to your computer and use it in GitHub Desktop.
Save robertwalker/621450 to your computer and use it in GitHub Desktop.
Remove Xcode build dir when switching branches
#!/bin/bash
#
# Post-checkout script to remove Xcode build directory when
# checkout out from a branch.
#
# post-checkout args
# <prev HEAD> <new HEAD> <changing branches, flag=1>
#
BUILD_DIR='build'
if [ $3 -eq 1 ]; then
if [ -d $BUILD_DIR ]; then
rm -rf $BUILD_DIR
echo "Hook: Removed 'build' folder"
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment