Skip to content

Commit c8a22d8

Browse files
authored
Update htop-appimage.sh
1 parent 5a6528c commit c8a22d8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

htop-appimage.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
#!/bin/sh
2-
2+
set -u
33
APP=htop
44
APPDIR="$APP".AppDir
55
SITE="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
1211
CURRENTDIR="$(dirname "$(readlink -f "$0")")" # DO NOT MOVE THIS
@@ -25,18 +24,16 @@ CURRENTDIR="$(dirname "$(readlink -f "$0")")"
2524
"$CURRENTDIR/bin/htop" "$@"
2625
EOF
2726
chmod a+x ./AppRun
28-
2927
APPVERSION=$(./AppRun -V | awk '{print $2}')
3028
if [ -z "$APPVERSION" ]; then echo "Failed to get version from htop"; exit 1; fi
3129

3230
# MAKE APPIMAGE
3331
cd ..
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$')
3533
wget -q "$APPIMAGETOOL" -O ./appimagetool && chmod a+x ./appimagetool
3634

3735
# Do the thing!
3836
ARCH=x86_64 VERSION="$APPVERSION" ./appimagetool -s ./"$APPDIR"
3937
ls ./*.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"
4239
echo "All Done!"

0 commit comments

Comments
 (0)