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
EEGITINIT()
{
# Initialise Git
echo -e "\033[34m Initialise Git On $EEGITDIR... \e[0m"
# Change Directory
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" \
|| OwnError "Unable To Git Commit On $EEGITDIR"
# Check .git
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()

Loading…
Cancel
Save