X-Git-Url: https://glassweightruler.freedombox.rocks/gitweb/xdg-ninja.git/blobdiff_plain/f6fa95e86ee65419ec3cceb473af5e62df405038..b6d3bc4e2f25365294a4bcd2ecebee64b919770c:/xdg-ninja.sh diff --git a/xdg-ninja.sh b/xdg-ninja.sh index b65844d..aa751bd 100755 --- a/xdg-ninja.sh +++ b/xdg-ninja.sh @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/usr/bin/env sh +# shellcheck disable=SC2016 USE_GLOW=true if ! command -v glow >/dev/null 2>/dev/null; then @@ -74,9 +75,9 @@ printf "\n" # Function to expand environment variables in string # https://stackoverflow.com/a/20316582/11110290 apply_shell_expansion() { - declare data="$1" - declare delimiter="__apply_shell_expansion_delimiter__" - declare command="cat <<$delimiter"$'\n'"$data"$'\n'"$delimiter" + data="$1" + delimiter="__apply_shell_expansion_delimiter__" + command=$(printf "cat <<%s\n%s\n%s" "$delimiter" "$data" "$delimiter") eval "$command" } @@ -171,14 +172,16 @@ check_program() { while IFS= read -r file; do check_file "$file" "$NAME" - done <<<"$(printf "%s" "$INPUT" | jq -rc '.files[]')" + done <