💥 fix(update-repo): tried calling 'y' as a function lol
This commit is contained in:
+6
-7
@@ -1,9 +1,8 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
source ./utils.sh
|
source ./utils.sh
|
||||||
|
|
||||||
Check_current_dir() {
|
Check_current_dir() {
|
||||||
if ! [[ -f ./utils.sh ]]; then
|
if ! git remote -v 2> /dev/null; then
|
||||||
Send_log warn "Looks like you're not in the repository directory! \
|
Send_log warn "Looks like you're not in the repository directory! \
|
||||||
Please run this script from the repo directory to avoid problems."
|
Please run this script from the repo directory to avoid problems."
|
||||||
Send_log "Exiting"
|
Send_log "Exiting"
|
||||||
@@ -20,7 +19,7 @@ Clean_local() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
Send_log "info" "Cleaning wallpapers..."
|
Send_log "Cleaning wallpapers..."
|
||||||
rm -rf ./wallpapers
|
rm -rf ./wallpapers
|
||||||
|
|
||||||
Send_log "Done cleaning"
|
Send_log "Done cleaning"
|
||||||
@@ -59,7 +58,7 @@ Update_remote() {
|
|||||||
if [[ -d $chosen ]] || [[ -f $chosen ]]; then
|
if [[ -d $chosen ]] || [[ -f $chosen ]]; then
|
||||||
git add $chosen
|
git add $chosen
|
||||||
Ask "Add more files/directories to queue?"
|
Ask "Add more files/directories to queue?"
|
||||||
if [[ $answer =~ y ]]; then
|
if $answer == "y"; then
|
||||||
Update_remote
|
Update_remote
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
@@ -81,7 +80,7 @@ Update_remote() {
|
|||||||
Send_log "Done!"
|
Send_log "Done!"
|
||||||
Ask "Push changes now? If not, you'll go back to the queue step"
|
Ask "Push changes now? If not, you'll go back to the queue step"
|
||||||
|
|
||||||
if [[ $answer == y ]]; then
|
if $answer == "y"; then
|
||||||
git push
|
git push
|
||||||
Send_log "Done pushing!"
|
Send_log "Done pushing!"
|
||||||
return
|
return
|
||||||
@@ -106,7 +105,7 @@ Send_log "Please run this script in it's current directory to avoid issues"
|
|||||||
Send_log "Tip: Press ^C([Ctrl] + [C]) to stop script at any time\n"
|
Send_log "Tip: Press ^C([Ctrl] + [C]) to stop script at any time\n"
|
||||||
|
|
||||||
Ask "Update local repository with host configurations?"
|
Ask "Update local repository with host configurations?"
|
||||||
if ! $answer == y; then
|
if ! $answer == "y"; then
|
||||||
Send_log "Exiting"
|
Send_log "Exiting"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
@@ -119,7 +118,7 @@ Update_local
|
|||||||
if command -v git; then
|
if command -v git; then
|
||||||
Ask "Would you like to commit to remote? (You will be prompted for commits)"
|
Ask "Would you like to commit to remote? (You will be prompted for commits)"
|
||||||
|
|
||||||
if $answer =~ y; then
|
if $answer == "y"; then
|
||||||
Update_remote
|
Update_remote
|
||||||
echo "Looks like it's done! Have a great day!"
|
echo "Looks like it's done! Have a great day!"
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user