Mitesh Shah
11 years ago
2 changed files with 36 additions and 0 deletions
@ -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 |
|||
} |
@ -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…
Reference in new issue