diff options
| author | Miquel Sabaté <mikisabate@gmail.com> | 2013-07-27 16:43:48 +0200 |
|---|---|---|
| committer | Miquel Sabaté <mikisabate@gmail.com> | 2013-07-27 16:43:48 +0200 |
| commit | 5e2b6d05c9fa3ae6ef9565fdd3ec268d0157cfc7 (patch) | |
| tree | 24150cc21e4fc9d0107dad3e2c717f49a7205d15 /bashrc | |
| parent | 20d37e60f9c42718e4f09d347888dda3a3208b7d (diff) | |
| download | dotfiles-5e2b6d05c9fa3ae6ef9565fdd3ec268d0157cfc7.tar.gz dotfiles-5e2b6d05c9fa3ae6ef9565fdd3ec268d0157cfc7.zip | |
Extended the p function so it also supports hg and svn
Diffstat (limited to 'bashrc')
| -rw-r--r-- | bashrc | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -80,6 +80,8 @@ export PATCH=$HOME/.patches # already exists, it will ask if the user wants to overwrite it. p() { path="$PATCH/$1.patch" + + # The patch file already exists. if [ -f $path ]; then echo "The patch \`$1' already exists." read -p "Do you want to overwrite its contents ? (Y/n) " yn @@ -87,5 +89,15 @@ p() { n | N | no | NO ) exit 1 esac fi - git diff > $path + + # Choose the proper SCM tool. + if [ -d .git ]; then + git diff > $path + elif [ -d .hg ]; then + hg diff > $path + elif [ -d .svn ]; then + svn diff > $path + else + echo 'Unsupported SCM.' + fi } |
