mirror of
https://github.com/YunoHost-Apps/streams_ynh.git
synced 2024-09-03 20:26:20 +02:00
We bring back ynh_exec_as to switch branches
This commit is contained in:
parent
736f5d633e
commit
a2818bf05a
1 changed files with 4 additions and 4 deletions
|
@ -72,15 +72,15 @@ set__git_branch_mode() {
|
||||||
if [ -z "$(cd "$install_dir" && git log release..dev)" ]
|
if [ -z "$(cd "$install_dir" && git log release..dev)" ]
|
||||||
then
|
then
|
||||||
# If git_branch was set to 0, switch to "release" branch
|
# If git_branch was set to 0, switch to "release" branch
|
||||||
(cd "$install_dir" && git checkout release)
|
(cd "$install_dir" && ynh_exec_as "$app" git checkout release)
|
||||||
ynh_print_info "Switching to \"release\" branch"
|
ynh_print_info "Switching to \"release\" branch"
|
||||||
else
|
else
|
||||||
ynh_print_err --message="\"release\" branch is behind your local \"dev\" branch, rolling back is not allowed here"
|
ynh_die --message="\"release\" branch is behind your local \"dev\" branch, rolling back is not allowed here"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
elif [ "$git_branch_mode" -eq "1" ]; then
|
elif [ "$git_branch_mode" -eq "1" ]; then
|
||||||
# If git_branch was set to 1, switch to "dev" branch
|
# If git_branch was set to 1, switch to "dev" branch
|
||||||
(cd "$install_dir" && git checkout dev)
|
(cd "$install_dir" && ynh_exec_as "$app" git checkout dev)
|
||||||
ynh_print_info "Switching to \"dev\" branch"
|
ynh_print_info "Switching to \"dev\" branch"
|
||||||
fi
|
fi
|
||||||
ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode"
|
ynh_app_setting_set --app=$app --key=git_branch_mode --value="$git_branch_mode"
|
||||||
|
|
Loading…
Add table
Reference in a new issue