From e5d665865e7cc800bb4deecd6aedcf3015e65b10 Mon Sep 17 00:00:00 2001 From: Deposite Pirate Date: Mon, 16 Feb 2026 02:22:00 +0100 Subject: Best effort dependency resolution Add a new check_install function that checks if a tool is installed and tries to install it on a best effort basic. Modify all scripts that benefit from it. Small indentation and correctness fixes. modified: functions/7za.fish modified: functions/alert.fish new file: functions/check_install.fish modified: functions/lscmd.fish modified: functions/rchmod.fish modified: functions/renlow.fish modified: functions/rlsxattr.fish modified: functions/rsdos.fish modified: functions/rsmac.fish modified: functions/rsxattr.fish modified: functions/uz.fish --- functions/rsxattr.fish | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'functions/rsxattr.fish') diff --git a/functions/rsxattr.fish b/functions/rsxattr.fish index 7003879..bd1456e 100644 --- a/functions/rsxattr.fish +++ b/functions/rsxattr.fish @@ -1,16 +1,11 @@ function rsxattr --description 'Recursively delete all user xattrs' -if not command -sq 'getfattr'; and command -sq 'setfattr' +if not check_install 'getfattr' 'attr' echo "Can't find xattr tools." return 1 end -if not command -sq 'sed' - echo "Can't find sed." - return 1 -end - -if not command -sq 'awk' +if not check_install 'awk' 'gawk' echo "Can't find awk." return 1 end -- cgit v1.3.1