Skip to content

Commit

Permalink
ci: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Mar 28, 2024
1 parent 6f00e42 commit 1b0cdf7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
9 changes: 5 additions & 4 deletions commands/is-missing
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,23 @@ function is_missing() (
# =====================================
# Action

function sudo_wrapper {
function __sudo_wrapper {
while test "$1" = '--'; do
shift
done
if test "$option_sudo" = 'yes' -o -n "$option_user" -o -n "$option_group"; then
sudo-helper --inherit --user="$option_user" --group="$option_group" \
-- "$@"
sudo-helper --inherit --user="$option_user" --group="$option_group" -- "$@"
return
else
"$@"
return
fi
}

local input
for input in "${option_inputs[@]}"; do
# just -e is faulty, as -e fails on broken symlinks
if sudo_wrapper -- test -e "$input" -o -L "$input"; then
if __sudo_wrapper -- test -e "$input" -o -L "$input"; then
return 1
fi
done
Expand Down
9 changes: 5 additions & 4 deletions commands/is-not-directory
Original file line number Diff line number Diff line change
Expand Up @@ -61,21 +61,22 @@ function is_not_directory() (
# =====================================
# Action

function sudo_wrapper {
function __sudo_wrapper {
while test "$1" = '--'; do
shift
done
if test "$option_sudo" = 'yes' -o -n "$option_user" -o -n "$option_group"; then
sudo-helper --inherit --user="$option_user" --group="$option_group" \
-- "$@"
sudo-helper --inherit --user="$option_user" --group="$option_group" -- "$@"
return
else
"$@"
return
fi
}

local input
for input in "${option_inputs[@]}"; do
if sudo_wrapper -- test ! -d "$input"; then
if __sudo_wrapper -- test ! -d "$input"; then
return 1
fi
done
Expand Down
9 changes: 5 additions & 4 deletions commands/is-present
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,23 @@ function is_present() (
# =====================================
# Action

function sudo_wrapper {
function __sudo_wrapper {
while test "$1" = '--'; do
shift
done
if test "$option_sudo" = 'yes' -o -n "$option_user" -o -n "$option_group"; then
sudo-helper --inherit --user="$option_user" --group="$option_group" \
-- "$@"
sudo-helper --inherit --user="$option_user" --group="$option_group" -- "$@"
return
else
"$@"
return
fi
}

local input
for input in "${option_inputs[@]}"; do
# just -e is faulty, as -e fails on broken symlinks
if sudo_wrapper -- test ! -e "$input" -a ! -L "$input"; then
if __sudo_wrapper -- test ! -e "$input" -a ! -L "$input"; then
return 1
fi
done
Expand Down

0 comments on commit 1b0cdf7

Please sign in to comment.