mirror of
https://github.com/YunoHost-Apps/streams_ynh.git
synced 2024-09-03 20:26:20 +02:00
git checkout without ynh_exec_as
This commit is contained in:
parent
65f81e2276
commit
07c4ed1a8c
1 changed files with 3 additions and 6 deletions
|
@ -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"
|
||||
|
|
Loading…
Add table
Reference in a new issue