improve brew bundle functions
This commit is contained in:
parent
bcc4f9cafe
commit
c80c4a7054
2 changed files with 15 additions and 4 deletions
15
.config/fish/functions/brew-save.fish
Executable file
15
.config/fish/functions/brew-save.fish
Executable file
|
@ -0,0 +1,15 @@
|
|||
function brew-save -d "Install a new homebrew cask and update the global Brewfile"
|
||||
set -f package $argv
|
||||
if set -f info_output (brew info $package 2> /dev/null)
|
||||
if echo $info_output | grep homebrew-cask &> /dev/null
|
||||
set -f brewfile_keyword cask
|
||||
else
|
||||
set -f brewfile_keyword brew
|
||||
end
|
||||
echo "$brewfile_keyword \"$package\"" >> ~/.Brewfile
|
||||
brew bundle --global
|
||||
else
|
||||
echo "package not found: $argv"
|
||||
return 1
|
||||
end
|
||||
end
|
|
@ -1,4 +0,0 @@
|
|||
function cask -d "Install a new homebrew cask and update the global Brewfile"
|
||||
echo "cask \"$argv\"" >> ~/.Brewfile
|
||||
brew bundle --global
|
||||
end
|
Loading…
Reference in a new issue