Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix ShellCheck warnings and add workflow for test
ShellCheck previously reported: ``` In please.sh line 123: response=(${response[@]}) ^------------^ SC2206: Quote to prevent word splitting/globbing, or split robustly with mapfile or read -a. In please.sh line 125: result=${response[@]::${#response[@]}-1} ^-- SC2124: Assigning an array to a string! Assign as array, or use * instead of @ to concatenate. In please.sh line 137: printf "${lightbulb}${cyan}Command:${black}\n" ^-- SC2059: Don't use variables in the printf format string. Use printf "..%s.." "$foo". In please.sh line 144: printf "${exclamation} ${yellow}What should I do? ${cyan}[use arrow keys to navigate]${black}\n" ^-- SC2059: Don't use variables in the printf format string. Use printf "..%s.." "$foo". For more information: https://www.shellcheck.net/wiki/SC2124 -- Assigning an array to a string! A... https://www.shellcheck.net/wiki/SC2206 -- Quote to prevent word splitting/g... https://www.shellcheck.net/wiki/SC2059 -- Don't use variables in the printf... ``` `result=${response[@]::${#response[@]}-1}` is not needed as `echo "${result}" | jq '.choices[0].message.content' --raw-output` will anyhow only consider the first element of `response`. Signed-off-by: Manfred Hanke <[email protected]>
- Loading branch information