Last active
August 29, 2015 14:09
-
-
Save abock/1cc1aea0ce1ca01d8f92 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# | |
# alias make=path/to/this/script | |
# | |
# if you don't want Makefiles to touch your | |
# git submodules. Insane. | |
# | |
nogitdir="/tmp/nogitsubmodulesfrommake" | |
mkdir -p "$nogitdir" | |
git="$(which git)" | |
{ cat <<EOF | |
#!/usr/bin/env bash | |
if [ "\$1" = "submodule" ]; then | |
echo "*** INSANITY: someone is messing with git submodules in a Makefile" | |
echo "*** not running this command:" | |
echo "***" | |
echo "*** git \$*" | |
echo "***" | |
sleep 2 | |
else | |
"$git" \$* | |
fi | |
EOF | |
} > "$nogitdir/git" | |
chmod +x "$nogitdir/git" | |
PATH="$nogitdir:$PATH" make $* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment