Skip to content

Commit

Permalink
fs-own: changes should not be enabled if quiet
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Sep 1, 2023
1 parent e60b2e8 commit 88a5f99
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions commands/fs-own
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ function fs_own_test() (
eval-tester --name='can own a durectory +verbose' --ignore-stdout --ignore-stderr \
-- fs-own --verbose -- "$dir"

eval-tester --name='can own a durectory +quiet +admin' --ignore-stdout --ignore-stderr \
eval-tester --name='can own a durectory +quiet +admin' --ignore-stderr \
-- fs-own --quiet --admin -- "$dir"

eval-tester --name='can own a durectory -quiet +admin' --ignore-stdout --ignore-stderr \
Expand Down Expand Up @@ -56,8 +56,9 @@ function fs_own() (
--verbose
if provied, will use --no-quiet for this command, and use --verbose on executed chmod/chown commands.
--no-changes
if provided, changes will not be reported if the operating system supports it.
--changes
if provided, changes will be reported if the operating system supports it.
defaults to enabled if --quiet is not provided.
--permissions=<permissions>
sets file and directory permissions
Expand Down Expand Up @@ -97,7 +98,7 @@ function fs_own() (

# process
local item paths=()
local option_quiet='yes'
local option_quiet=''
local option_verbose='no'
local option_changes='' # os support
local option_owner=''
Expand Down Expand Up @@ -213,13 +214,18 @@ function fs_own() (

# adjustments: changes
if test -z "$option_changes"; then
if is-mac; then
if test "$option_quiet" = 'yes' || is-mac; then
option_changes='no'
else
option_changes='yes'
fi
fi

# adjustments: quiet
if test -z "$option_quiet"; then
option_quiet='yes'
fi

# apply args
if test "$option_changes" = 'yes'; then
if is-mac || is-alpine; then
Expand Down

0 comments on commit 88a5f99

Please sign in to comment.