Browse Source

Merge branch 'refactor' of github.com:rtCamp/easyengine into refactor

old-stable
Mitesh Shah 11 years ago
parent
commit
d07e57d62b
  1. 15
      src/lib/ee_lib_git_commit.sh
  2. 21
      src/lib/ee_lib_git_init.sh

15
src/lib/ee_lib_git_commit.sh

@ -0,0 +1,15 @@
# Record changes to the repository
function ee_lib_git_commit()
{
cd $EE_GIT_DIR \
|| ee_lib_error "Unable to change directory $EE_GIT_DIR, exit status = " $?
if [ $(git status -s | wc -l) -ne 0 ]; then
ee_lib_echo "Commiting changes inside $EE_GIT_DIR, please wait..."
# Add newly created files && commit it
git add --all && git commit -am "$EE_GIT_MESSAGE" &>> $EE_COMMAND_LOG \
|| ee_lib_error "Unable to Git commit on $EE_GIT_DIR, exit status = " $?
fi
}

21
src/lib/ee_lib_git_init.sh

@ -0,0 +1,21 @@
# Initialise Git
function ee_lib_git_init()
{
# Change directory
cd $EE_GIT_DIR || ee_lib_error "Unable to change directory $EE_GIT_DIR, exit status = " $?
# Check .git
if [ ! -d .git ]; then
ee_lib_echo "Initialise Git On $EE_GIT_DIR..."
git init &>> $EE_COMMAND_LOG \
|| ee_lib_error "Unable to initialize Git on $EE_GIT_DIR, exit status = " $?
fi
# Check for untracked files
if [ $(git status -s | wc -l) -ne 0 ]; then
# Add files in Git version control
git add --all && git commit -am "Initialize Git On $EE_GIT_DIR" &>> $EE_COMMAND_LOG \
|| ee_lib_error "Unable to Git commit on $EE_GIT_DIR, exit status = " $?
fi
}
Loading…
Cancel
Save