Last active
April 26, 2016 09:42
-
-
Save mikesorae/54e8383e8d49037463c8b87e6043a6e1 to your computer and use it in GitHub Desktop.
make a git tracked file lower
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
#!/bin/sh | |
if [ $# -eq 0 ]; then | |
echo "you need to pass a file or directory name to the command" | |
exit 1 | |
fi | |
if [ ! -e $1 ]; then | |
echo "file not exists" | |
exit 1 | |
fi | |
if [ ! -d $1 ]; then | |
echo "this is not a directory." | |
exit 1 | |
fi | |
to_lower() { | |
input=$(echo $1 | tr '[A-Z]' '[a-z]') | |
echo $input | |
} | |
git_mv_lower() { | |
org=$(to_lower $1) | |
git mv $1 _tmp | |
git mv _tmp $org | |
} | |
git_mv_lower $1 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment