Mitesh Shah
11 years ago
6 changed files with 126 additions and 43 deletions
@ -0,0 +1,27 @@ |
|||
# Initialize Git |
|||
|
|||
function ee_lib_git() |
|||
{ |
|||
for ee_git_dir in $@; do |
|||
if [ $ee_git_dir != ${@: -1} ]; then |
|||
|
|||
# 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 "Initialize 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 |
|||
ee_lib_echo "Committing changes inside $EE_GIT_DIR, please wait..." |
|||
git add --all && git commit -am ${@: -1} &>> $EE_COMMAND_LOG \ |
|||
|| ee_lib_error "Unable to Git commit on $ee_git_dir, exit status = " $? |
|||
fi |
|||
fi |
|||
done |
|||
} |
@ -1,15 +0,0 @@ |
|||
# 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 "Committing 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 |
|||
} |
@ -1,23 +0,0 @@ |
|||
# Initialize Git |
|||
|
|||
function ee_lib_git_init() |
|||
{ |
|||
for ee_git_dir in $@; do |
|||
# 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 "Initialize 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 |
|||
done |
|||
} |
@ -1,8 +1,8 @@ |
|||
# Set ownership of /var/www/$EE_DOMAIN to www-data:www-data |
|||
# Adjust permission |
|||
|
|||
function ee_lib_permissions() |
|||
{ |
|||
ee_lib_echo "Changing ownership of /var/www/$EE_DOMAIN..." |
|||
ee_lib_echo "Changing ownership of /var/www/$EE_DOMAIN, please wait..." |
|||
chown -R $EE_PHP_USER:$EE_PHP_USER /var/www/$EE_DOMAIN/ \ |
|||
|| ee_lib_error "Unable to change ownership for $EE_DOMAIN, exit status = " $? |
|||
} |
|||
|
Loading…
Reference in new issue