update README, atuo auth git

This commit is contained in:
Joseph Le 2023-10-13 17:44:05 +11:00
parent 7ad0b8b385
commit f4e4057a74
2 changed files with 27 additions and 31 deletions

View File

@ -56,19 +56,6 @@ if [ -d "/etc/systemd/system" ]; then
echo -e "\e[32mOK: $path exists\e[0m"
sleep 1
fi
else
if [[ $line == *"REPOSITORY"* ]]; then
path="${line#*=}"
if git ls-remote -q --exit-code "$path" > /dev/null; then
echo -e "\e[32mOK: Repository $path exists\e[0m"
sleep 1
else
echo ""
echo -e "\e[41mError: Repository $path not exists.\e[0m"
echo ""
exit 1
fi
fi
fi
done <"$input_file" &&

View File

@ -7,7 +7,16 @@ REPOSITORY_AUTH="https://$GIT_USERNAME:$GIT_PASSWORD@$(echo $GIT_REPOSITORY | se
cd "$PROJECT_PATH" &&
SET_ORIGIN=$(git remote set-url origin $REPOSITORY_AUTH)
echo "$SET_ORIGIN"
if git ls-remote -q --exit-code "$REPOSITORY_AUTH" > /dev/null; then
echo -e "\e[32mOK: Repository $GIT_REPOSITORY exists\e[0m"
sleep 1
else
echo ""
echo -e "\e[41mError: Repository $GIT_REPOSITORY not exists.\e[0m"
echo ""
exit 1
fi
# Kiểm tra xem Node.js đã cài đặt chưa
if ! command -v node &> /dev/null; then