Browse Source

Only Initialise Git If .git not exist

old-stable
Mitesh Shah 12 years ago
parent
commit
16b936dbc7
  1. 23
      usr/local/sbin/easyengine

23
usr/local/sbin/easyengine

@ -304,12 +304,25 @@ PURGEALL()
# EE GIT Function # EE GIT Function
EEGITINIT() EEGITINIT()
{ {
# Initialise Git # Change Directory
echo -e "\033[34m Initialise Git On $EEGITDIR... \e[0m"
cd $EEGITDIR || OwnError "Unable To Change Directory $EEGITDIR" cd $EEGITDIR || OwnError "Unable To Change Directory $EEGITDIR"
git init || OwnError "Unable To Initialise Git On $EEGITDIR"
git add . && git commit -am "Initialise Git On $EEGITDIR" \ # Check .git
|| OwnError "Unable To Git Commit On $EEGITDIR" if [ ! -d .git ]
then
# Initialise Git
echo -e "\033[34m Initialise Git On $EEGITDIR... \e[0m"
git init || OwnError "Unable To Initialise Git On $EEGITDIR"
fi
# Check For Untracked Files
git status | grep clean
if [ $? -ne 0 ]
then
# Add Files In Git Version Control
git add . && git commit -am "Initialise Git On $EEGITDIR" \
|| OwnError "Unable To Git Commit On $EEGITDIR"
fi
} }
EEGITCOMMIT() EEGITCOMMIT()

Loading…
Cancel
Save