diff options
| author | Deposite Pirate | 2025-10-12 13:46:13 +0200 |
|---|---|---|
| committer | Deposite Pirate | 2025-10-12 13:46:13 +0200 |
| commit | 2be0411de222969202f0d736eed0e20312a32bd5 (patch) | |
| tree | 04313695b24041f3b11d5580ff4d95b8827a59c0 /functions/rsxattr.fish | |
| parent | f671c8b0b63bc31997012f5452ec745d44549606 (diff) | |
Fix error checking of rsxattr
We're not using find here.
modified: functions/rsxattr.fish
Diffstat (limited to 'functions/rsxattr.fish')
| -rw-r--r-- | functions/rsxattr.fish | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/functions/rsxattr.fish b/functions/rsxattr.fish index 4101890..7003879 100644 --- a/functions/rsxattr.fish +++ b/functions/rsxattr.fish @@ -1,7 +1,7 @@ function rsxattr --description 'Recursively delete all user xattrs' -if not command -sq 'find' - echo "Can't find find." +if not command -sq 'getfattr'; and command -sq 'setfattr' + echo "Can't find xattr tools." return 1 end @@ -15,11 +15,6 @@ if not command -sq 'awk' return 1 end -if not command -sq 'setfattr'; and command -sq 'getfattr' - echo "Can't find xattr tools." - return 1 -end - for file in (getfattr -R -h -d . 2>/dev/null | grep '^# file:' | sed 's/^# file: //') for attr in (getfattr -m '^user\.' "$file" 2>/dev/null | awk '/^[^#]/ {print $1}') setfattr -x $attr $file 2>/dev/null |
