From 4fe593702aa9ffe357cd160ffec530134a24f917 Mon Sep 17 00:00:00 2001 From: anmol26s Date: Sun, 14 Feb 2021 05:39:24 +0530 Subject: [PATCH] Fixed install & install --- scripts/install | 2 +- scripts/upgrade | 36 ++++++++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 3 deletions(-) diff --git a/scripts/install b/scripts/install index 2b5fc5f2..3ecc821a 100755 --- a/scripts/install +++ b/scripts/install @@ -115,7 +115,7 @@ pushd "$final_path" echo linking $base ln -s ../extend/addon/hzaddons/$base $base -done + done popd diff --git a/scripts/upgrade b/scripts/upgrade index 9a216bd2..a928e9db 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -72,8 +72,40 @@ fi ynh_script_progression --message="Upgrading source files..." if [ `cd $final_path && git rev-parse --is-inside-work-tree` ]; then - `cd $final_path && util/udall` - chmod -R 777 $final_path/store + pushd "$final_path" + git pull + cd extend/addon/hzaddons + git pull + cd ../../.. + filelist=(`ls extend/addon/hzaddons`) + cd addon + for a in "${filelist[@]}" ; do + base=`basename $a` + if [ $base = '.git' ]; then + #echo 'ignoring git' + continue; + fi + if [ ! -d ../extend/addon/hzaddons/$base ]; then + #echo $a 'not a directory' + continue; + fi + if [ -x $base ]; then + #echo $base 'file exists' + continue; + fi + + echo linking $base + + ln -s ../extend/addon/hzaddons/$base $base + done + for x in `ls` ; do + if [ -L "$x" ] && ! [ -e "$x" ]; then + echo "removing dead symlink $x" ; + rm -- "$x"; + fi; + done + popd + chmod -R 777 $final_path/store else # Create a temporary directory