diff --git a/scripts/install b/scripts/install index 2691a50..f2a8091 100755 --- a/scripts/install +++ b/scripts/install @@ -26,9 +26,11 @@ git config --system --add safe.directory $install_dir # Note: We use git instead of ynh_setup_source, cause this repo use submodules git clone https://github.com/zamentur/libreto.git "$install_dir" --quiet +chown -R $app:www-data "$install_dir" + pushd "$install_dir" - git checkout $COMMIT --quiet - git submodule update --init --recursive --quiet + ynh_exec_as $app git checkout $COMMIT --quiet + ynh_exec_as $app git submodule update --init --recursive --quiet popd chmod -R o-rwx "$install_dir" diff --git a/scripts/upgrade b/scripts/upgrade index a56d22b..b07ed95 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -25,15 +25,14 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=5 - git config --system --add safe.directory $install_dir + chown -R $app:www-data "$install_dir" # Download, check integrity, uncompress and patch the source from app.src pushd "$install_dir" - git checkout master - git pull --quiet - git checkout $COMMIT --quiet - git config --global --add safe.directory $install_dir/libreto/vendor/Markdownify - git submodule update --init --recursive --quiet + ynh_exec_as $app git checkout master + ynh_exec_as $app git pull --quiet + ynh_exec_as $app git checkout $COMMIT --quiet + ynh_exec_as $app git submodule update --init --recursive --quiet popd fi