mirror of
https://github.com/YunoHost-Apps/libreto_ynh.git
synced 2024-09-03 19:36:14 +02:00
Fix upgrade before git repo move
This commit is contained in:
parent
f88d59fc35
commit
56a32e36fd
1 changed files with 13 additions and 1 deletions
|
@ -11,6 +11,18 @@ source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# STANDARD UPGRADE STEPS
|
# STANDARD UPGRADE STEPS
|
||||||
|
#=================================================
|
||||||
|
# ENSURE DOWNWARD COMPATIBILITY
|
||||||
|
#=================================================
|
||||||
|
ynh_script_progression --message="Ensuring downward compatibility..." --weight=1
|
||||||
|
|
||||||
|
if [ ! -d "$install_dir/libreto/.git" ]; then
|
||||||
|
# Move git repository one step down"
|
||||||
|
mkdir "$install_dir/__new__"
|
||||||
|
find "$install_dir" -mindepth 1 -maxdepth 1 -not -name "__new__" -print0 | xargs -0 mv -t "$install_dir/__new__"
|
||||||
|
mv "$install_dir/__new__" "$install_dir/libreto"
|
||||||
|
fi
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
# DOWNLOAD, CHECK AND UNPACK SOURCE
|
||||||
#=================================================
|
#=================================================
|
||||||
|
@ -21,7 +33,7 @@ chown -R $app:www-data "$install_dir"
|
||||||
# Download, check integrity, uncompress and patch the source from app.src
|
# Download, check integrity, uncompress and patch the source from app.src
|
||||||
ynh_exec_as "$app" git -C "$install_dir/libreto" checkout master
|
ynh_exec_as "$app" git -C "$install_dir/libreto" checkout master
|
||||||
ynh_exec_as "$app" git -C "$install_dir/libreto" pull --quiet
|
ynh_exec_as "$app" git -C "$install_dir/libreto" pull --quiet
|
||||||
ynh_exec_as "$app" git -C "$install_dir/libreto" checkout $COMMIT --quiet
|
ynh_exec_as "$app" git -C "$install_dir/libreto" checkout "$COMMIT" --quiet
|
||||||
ynh_exec_as "$app" git -C "$install_dir/libreto" submodule update --init --recursive --quiet
|
ynh_exec_as "$app" git -C "$install_dir/libreto" submodule update --init --recursive --quiet
|
||||||
|
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
|
|
Loading…
Reference in a new issue