Created
June 25, 2015 22:32
-
-
Save jferrao/e3d2c71e8a431b995959 to your computer and use it in GitHub Desktop.
Mercurial pull from all subdirectories
This file contains hidden or 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/bash | |
basedir=$(pwd -P) | |
for subdir in $(find . -maxdepth 1 -type d ); | |
do | |
dir="$basedir"/$(basename "$subdir") | |
# Check if sub-directory is a Mercurial repository | |
if [ -n "$(hg --cwd $dir root)" ]; | |
then | |
cd "$dir" | |
pwd | |
/usr/bin/expect<<EOF | |
spawn hg pull | |
expect "user:" | |
send "username\n" | |
expect "password:" | |
send "password\n" | |
interact | |
expect eof | |
EOF | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment