Skip to content

Commit

Permalink
yes/no in init and fixed resolved printing already resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
Sondre-Lovas committed Jan 24, 2024
1 parent 0991839 commit 339eccd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 7 additions & 5 deletions smud-cli/functions-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set_upstream()

i=0

if [ $new_upstrea m ]; then
if [ $new_upstream ]; then
remove_upstream_command="git remote rm upstream"
run_command remove-upstream --command-from-var=remove_upstream_command --debug-title='Removing upstream config URL'
if [ "$new_upstream" = "-" ]; then
Expand Down Expand Up @@ -68,7 +68,6 @@ merge_upstream()

fetch_origin()
{
printf "${gray}Fetching origin\n${normal}"
fetch_origin_command="git fetch origin"
run_command fetch-origin --command-from-var=fetch_origin_command --debug-title='Fetching origin' || return
}
Expand Down Expand Up @@ -105,15 +104,18 @@ init()
return
fi


upstream_url="${2:-}"
echo "$upstream_url"

remote_origin=$(git config --get remote.origin.url)
remote_upstream=$(git config --get remote.upstream.url)

if [ ! "$is_repo" ]; then
echo "Init repo"
local yes_no="y"
ask yes_no $yellow "The current directory does not seem to be a git repository\nWould you like to initialize the repository and merge the remote upstream? (yes/no)"
if [ ! "$yes_no" = "yes" ]; then
printf "${yellow}Aborting"
exit 0
fi
init_repo
if [ ! -n "$remote_upstream" ]; then
set_upstream "$upstream_url"
Expand Down
5 changes: 4 additions & 1 deletion smud-cli/functions-upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ upgrade()
errors_resolved="true"
break
fi

# Clear the status_map
unset status_map
done
fi

Expand All @@ -196,7 +199,7 @@ upgrade()
printf "${green}All selected $context was successfully upgraded.${normal}"
echo ""
if [ ! $silent ] && [ ! $remote ]; then
printf "${yellow}Do you want to push applied changes to remote branch (Yes/No)? ${normal}"
printf "${yellow}Do you want to push applied changes to remote branch $remote (Yes/No)? ${normal}"
read yes_no
yes_no=$(echo "$yes_no" | tr '[:upper:]' '[:lower:]')
printf "${gray}You selected: $yes_no${normal}\n"
Expand Down

0 comments on commit 339eccd

Please sign in to comment.