File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 11#! /bin/sh
2-
2+ set -u
33APP=htop
44APPDIR=" $APP " .AppDir
55SITE=" htop-dev/htop"
66
77# CREATE DIRECTORIES
8- if [ -z " $APP " ]; then exit 1; fi
9- mkdir -p ./" $APP /$APPDIR " && cd ./" $APP /$APPDIR " || exit 1
8+ [ -n " $APP " ] && mkdir -p ./" $APP /$APPDIR " && cd ./" $APP /$APPDIR " || exit 1
109
1110# DOWNLOAD AND BUILD HTOP
1211CURRENTDIR=" $( dirname " $( readlink -f " $0 " ) " ) " # DO NOT MOVE THIS
@@ -25,18 +24,16 @@ CURRENTDIR="$(dirname "$(readlink -f "$0")")"
2524"$CURRENTDIR/bin/htop" "$@"
2625EOF
2726chmod a+x ./AppRun
28-
2927APPVERSION=$( ./AppRun -V | awk ' {print $2}' )
3028if [ -z " $APPVERSION " ]; then echo " Failed to get version from htop" ; exit 1; fi
3129
3230# MAKE APPIMAGE
3331cd ..
34- APPIMAGETOOL=$( wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed ' s/"/ /g; s/ /\n/g' | grep -o ' https.*continuous.*tool.*86_64.*mage$' )
32+ APPIMAGETOOL=$( wget -q https://api.github.com/repos/probonopd/go-appimage/releases -O - | sed ' s/"/ /g; s/ /\n/g' | grep -oi ' https.*continuous.*tool.*86_64.*mage$' )
3533wget -q " $APPIMAGETOOL " -O ./appimagetool && chmod a+x ./appimagetool
3634
3735# Do the thing!
3836ARCH=x86_64 VERSION=" $APPVERSION " ./appimagetool -s ./" $APPDIR "
3937ls ./* .AppImage || { echo " appimagetool failed to make the appimage" ; exit 1; }
40- if [ -z " $APP " ]; then exit 1; fi # Being extra safe lol
41- mv ./* .AppImage .. && cd .. && rm -rf ./" $APP "
38+ [ -n " $APP " ] && mv ./* .AppImage .. && cd .. && rm -rf ./" $APP "
4239echo " All Done!"
You can’t perform that action at this time.
0 commit comments