mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-19 03:14:03 +00:00
modules/programs/command-not-found: Fix ShellCheck warnings
https://github.com/koalaman/shellcheck/wiki/SC2086 Double quote to prevent globbing and word splitting. https://github.com/koalaman/shellcheck/wiki/SC2166 Prefer `[ p ] && [ q ]` as `[ p -a q ]` is not well defined. Signed-off-by: Anders Kaseorg <andersk@mit.edu>
This commit is contained in:
parent
d44b6ae6cb
commit
d8ef13fc13
@ -49,10 +49,10 @@ in
|
||||
''
|
||||
# This function is called whenever a command is not found.
|
||||
command_not_found_handle() {
|
||||
local p=${commandNotFound}/bin/command-not-found
|
||||
if [ -x $p -a -f ${cfg.dbPath} ]; then
|
||||
local p='${commandNotFound}/bin/command-not-found'
|
||||
if [ -x "$p" ] && [ -f '${cfg.dbPath}' ]; then
|
||||
# Run the helper program.
|
||||
$p "$@"
|
||||
"$p" "$@"
|
||||
# Retry the command if we just installed it.
|
||||
if [ $? = 126 ]; then
|
||||
"$@"
|
||||
@ -70,10 +70,10 @@ in
|
||||
''
|
||||
# This function is called whenever a command is not found.
|
||||
command_not_found_handler() {
|
||||
local p=${commandNotFound}/bin/command-not-found
|
||||
if [ -x $p -a -f ${cfg.dbPath} ]; then
|
||||
local p='${commandNotFound}/bin/command-not-found'
|
||||
if [ -x "$p" ] && [ -f '${cfg.dbPath}' ]; then
|
||||
# Run the helper program.
|
||||
$p "$@"
|
||||
"$p" "$@"
|
||||
|
||||
# Retry the command if we just installed it.
|
||||
if [ $? = 126 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user