From 07c4ed1a8c03fe4be20256d92a85220ccd76221a Mon Sep 17 00:00:00 2001 From: dragondaddy Date: Tue, 14 Nov 2023 03:22:02 +0100 Subject: [PATCH] git checkout without ynh_exec_as --- scripts/config | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/scripts/config b/scripts/config index b3f277e..49b07ce 100644 --- a/scripts/config +++ b/scripts/config @@ -24,8 +24,7 @@ current_fpm_footprint=$(ynh_app_setting_get --app=$app --key=fpm_footprint) get__git_branch_mode() { # Maintenance mode status - git_branch_mode_status="$(cd "$install_dir" && ynh_exec_as "$app" \ - git branch --show-current)" 2> /dev/null + git_branch_mode_status="$(cd "$install_dir" && git branch --show-current)" 2> /dev/null if echo $git_branch_mode_status | grep -q "release" then echo "0" @@ -69,13 +68,11 @@ get__free_footprint() { set__git_branch_mode() { if [ "$git_branch_mode" -eq "0" ]; then # If git_branch was set to 0, switch to "release" branch - (cd "$install_dir" && ynh_exec_as "$app" \ - git checkout release) + (cd "$install_dir" && git checkout release) ynh_print_info "Switching to \"release\" branch" elif [ "$git_branch_mode" -eq "1" ]; then # If git_branch was set to 1, switch to "dev" branch - (cd "$install_dir" && ynh_exec_as "$app" \ - git checkout dev) + (cd "$install_dir" && git checkout dev) ynh_print_info "Switching to \"dev\" branch" fi ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode"