|
@ -33,13 +33,14 @@ function ee_lib_error() |
|
|
function ee_lib_git() |
|
|
function ee_lib_git() |
|
|
{ |
|
|
{ |
|
|
for ee_git_dir in ${@:1:$(($#-1))}; do |
|
|
for ee_git_dir in ${@:1:$(($#-1))}; do |
|
|
|
|
|
if [ -d $ee_git_dir ]; then |
|
|
# Change directory |
|
|
# Change directory |
|
|
cd $ee_git_dir || ee_lib_error "Unable to change directory $ee_git_dir, exit status = " $? |
|
|
cd $ee_git_dir |
|
|
|
|
|
|
|
|
# Check .git |
|
|
# Check .git |
|
|
if [ ! -d .git ]; then |
|
|
if [ ! -d .git ]; then |
|
|
# ee_lib_echo "Initialize Git on ${ee_git_dir}" |
|
|
# ee_lib_echo "Initialize Git on ${ee_git_dir}" |
|
|
git init &>> $EE_UPDATE_LOG \ |
|
|
git init &>> $EE_COMMAND_LOG \ |
|
|
|| ee_lib_error "Unable to initialize Git on $ee_git_dir, exit status = " $? |
|
|
|| ee_lib_error "Unable to initialize Git on $ee_git_dir, exit status = " $? |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
@ -47,9 +48,10 @@ function ee_lib_git() |
|
|
if [ $(git status -s | wc -l) -ne 0 ]; then |
|
|
if [ $(git status -s | wc -l) -ne 0 ]; then |
|
|
# Add files in Git version control |
|
|
# Add files in Git version control |
|
|
ee_lib_echo "Git commit on $ee_git_dir, please wait..." |
|
|
ee_lib_echo "Git commit on $ee_git_dir, please wait..." |
|
|
git add --all && git commit -am "${@: -1}" &>> $EE_UPDATE_LOG \ |
|
|
git add --all && git commit -am "${@: -1}" &>> $EE_COMMAND_LOG \ |
|
|
|| ee_lib_error "Unable to Git commit on $ee_git_dir, exit status = " $? |
|
|
|| ee_lib_error "Unable to Git commit on $ee_git_dir, exit status = " $? |
|
|
fi |
|
|
fi |
|
|
|
|
|
fi |
|
|
done |
|
|
done |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|