Skip to content

Commit

Permalink
use escape codes instead of tput to drop ncurses dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Phantop committed Mar 24, 2024
1 parent c09f7ea commit f87a426
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions appdwarf
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,12 @@ case "$1" in
-p | -z | --prefix | --zzexe )
zzexe "$@" ;;
--version | -v )
tput setaf 2; echo appdwarf 2023.11.16
tput setaf 6; echo Built by July 🏳️‍🌈; exit ;;
printf '\e[32m'
echo 'appdwarf 2023.11.16'
printf '\e[36m'
echo Built by July 🏳️‍🌈
printf '\e[0m'
exit ;;
-* | '' )
echo "Usage: appdwarf [option] [APP/FILE/FOLDER/URL] [compression options]"
echo " -a [FILE] write example AppRun file"
Expand Down Expand Up @@ -133,7 +137,9 @@ if [ ! -d "$1" ]; then # directory doesn't exist, see if this is an appimage
set -- "$app" "$@"
test "$FETCH" && chmod +x "$1" && exit
else
tput setaf 1; echo "No valid remote or local input found. Exiting..." >&2
printf '\e[31m' >&2
echo "No valid remote or local input found. Exiting..." >&2
printf '\e[0m' >&2
rm -f "$app"; exit 1
fi
fi
Expand All @@ -148,7 +154,9 @@ if [ ! -d "$1" ]; then # directory doesn't exist, see if this is an appimage
shift
set -- "$app" "$@"
else
tput setaf 4; echo "$1 is not an AppImage, it will be zzexe'd"
printf '\e[34m'
echo "$1 is not an AppImage, it will be zzexe'd"
printf '\e[0m'
zzexe -z "$@"
fi
fi
Expand Down

0 comments on commit f87a426

Please sign in to comment.