Moved Script To a Function.

This commit is contained in:
Varun 2020-11-10 16:56:16 +05:30
parent 60be99727b
commit f83e8c90a4
No known key found for this signature in database
GPG key ID: 93FB46DCF16E0D6F
2 changed files with 38 additions and 4 deletions

View file

@ -24,8 +24,8 @@ cp -r * "${INSTALL_DIR}"
sed -i 's|/gh-toolkit/|'"$INSTALL_DIR"'|g' shell.sh
## Setup Install Script
cd "${INSTALL_DIR}${GITHUB_SCRIPTS_FOLDER}/scripts/"
cp -r * /usr/local/bin/
#cd "${INSTALL_DIR}${GITHUB_SCRIPTS_FOLDER}/scripts/"
#cp -r * /usr/local/bin/
## Removed Unwanted Files.
cd "${INSTALL_DIR}"

View file

@ -13,10 +13,44 @@ gh_mask_output() {
echo "::add-mask::${1}"
}
is_empty_var(){
is_empty_var() {
if [ -z "$1" ]; then
echo "$2"
else
echo "$1"
fi
}
gitconfig() {
GIT_EMAIL=""
GIT_USERNAME=""
LOCAL="no"
if [ ! -z "$1" ]; then
GIT_USERNAME="$1"
fi
if [ ! -z "$2" ]; then
GIT_EMAIL="$2"
fi
if [ ! -z "$3" ]; then
LOCAL="$2"
fi
gh_log_group_start "🗃 Git Config"
gh_log " > Name : $GIT_USERNAME"
gh_log " > Email : $GIT_EMAIL"
if [ "$LOCAL" != true ]; then
gh_log " > Global Config : true"
git config --global user.email "$GIT_EMAIL"
git config --global user.name "$GIT_USERNAME"
else
gh_log " > Global Config : false"
git config user.email "$GIT_EMAIL"
git config user.name "$GIT_USERNAME"
fi
gh_log_group_end ""
gh_log ""
}