scripts

My personal collection of scripts
git clone git://src.gearsix.net/scripts
Log | Files | Refs | Atom | README | LICENSE

commit 183c5c5ea18a61ff662ba0886afab58658d5cbfc
parent 96109ed0a2f42e23353d548898148fed1448c1f9
Author: gearsix <gearsix@tuta.io>
Date:   Sun, 13 Mar 2022 17:56:00 +0000

some work on install.sh

Diffstat:
Minstall.sh | 17++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/install.sh b/install.sh @@ -48,13 +48,17 @@ install_script () { src=$1 dest=$2 + cmd= if [[ $ln -eq 0 ]]; then - echo "install $src -> $dest" - install -pDm755 $src $dest + cmd=$(install -vpDm755 $src $dest) else # ln the file - echo "ln -s $src -> $dest" - chmod +x $src - ln -sf $(readlink -f $src) $dest + cmd=$(chmod +x $src && echo ""; ln -vsf $(readlink -f $src) $dest) + fi + + if [[ ! $cmd ]]; then + echo "something went wrong"; exit 1; + else + echo $cmd fi } ## install_yn = installs $1 to $2, prints $3 if user asks for "info" @@ -80,8 +84,7 @@ install_yn () { fi if [[ $yn == "y" || $yn == "Y" || $yn == "yes" ]]; then - install $src $dest - printf "\tinstalled $dest\n" + install_script $src $dest ask=1 elif [[ $yn == "n" || $yn == "N" || $yn == "no" ]]; then printf "\tskipping...\n"