mirror of
https://github.com/ivuorinen/dotfiles.git
synced 2026-02-15 19:53:42 +00:00
feat(config): fish configs
This commit is contained in:
23
config/fish/functions/has_cask.fish
Normal file
23
config/fish/functions/has_cask.fish
Normal file
@@ -0,0 +1,23 @@
|
||||
# @halostatue/fish-brew/functions/has_cask.fish:v3.2.1
|
||||
|
||||
function has_cask --description 'Test if the named cask or casks are installed'
|
||||
command --query brew
|
||||
or return 1
|
||||
|
||||
argparse --min-args 1 A/all -- $argv
|
||||
or return 1
|
||||
|
||||
set --function found 0
|
||||
|
||||
for cask in $argv
|
||||
if test -d (brew --prefix)/Caskroom/$cask
|
||||
set found (math $found + 1)
|
||||
end
|
||||
end
|
||||
|
||||
if set --query _flag_all
|
||||
test $found -eq (count $argv)
|
||||
else
|
||||
test $found -ne 0
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user