Use consistent bash5 style for conditionals and quoting
This commit is contained in:
@@ -5,7 +5,7 @@ set -e
|
||||
ICON_DIR="$HOME/.local/share/applications/icons"
|
||||
DESKTOP_DIR="$HOME/.local/share/applications/"
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
if (( $# == 0 )); then
|
||||
# Find all TUIs
|
||||
while IFS= read -r -d '' file; do
|
||||
if grep -qE '^Exec=.*(\$TERMINAL|xdg-terminal-exec).*-e' "$file"; then
|
||||
@@ -20,7 +20,7 @@ if [ "$#" -eq 0 ]; then
|
||||
# Convert newline-separated string to array
|
||||
APP_NAMES=()
|
||||
while IFS= read -r line; do
|
||||
[[ -n "$line" ]] && APP_NAMES+=("$line")
|
||||
[[ -n $line ]] && APP_NAMES+=("$line")
|
||||
done <<< "$APP_NAMES_STRING"
|
||||
else
|
||||
echo "No TUIs to remove."
|
||||
@@ -31,7 +31,7 @@ else
|
||||
APP_NAMES=("$@")
|
||||
fi
|
||||
|
||||
if [[ ${#APP_NAMES[@]} -eq 0 ]]; then
|
||||
if (( ${#APP_NAMES[@]} == 0 )); then
|
||||
echo "You must provide TUI names."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user