From ded5962d24779fb0d7d4e01382801dd98e88bffa Mon Sep 17 00:00:00 2001 From: Stefan Imhoff Date: Sat, 31 Dec 2022 11:17:53 +0100 Subject: [PATCH] feat(fish): add some of my often used functions --- fish/functions/delete-node-modules.fish | 3 +++ fish/functions/homebrew-backup.fish | 4 ++++ fish/functions/homebrew-restore.fish | 3 +++ fish/functions/replace-kitty-logo.fish | 5 +++++ fish/functions/update.fish | 10 ++++++++++ 5 files changed, 25 insertions(+) create mode 100644 fish/functions/delete-node-modules.fish create mode 100644 fish/functions/homebrew-backup.fish create mode 100644 fish/functions/homebrew-restore.fish create mode 100644 fish/functions/replace-kitty-logo.fish create mode 100644 fish/functions/update.fish diff --git a/fish/functions/delete-node-modules.fish b/fish/functions/delete-node-modules.fish new file mode 100644 index 0000000..5239adb --- /dev/null +++ b/fish/functions/delete-node-modules.fish @@ -0,0 +1,3 @@ +function deleteNodeModules --description "Delete all node_modules folders in a folder and subfolders" + find . -name "node_modules" -type d -exec rm -rf '{}' + +end diff --git a/fish/functions/homebrew-backup.fish b/fish/functions/homebrew-backup.fish new file mode 100644 index 0000000..a15558d --- /dev/null +++ b/fish/functions/homebrew-backup.fish @@ -0,0 +1,4 @@ +function homebrewBackup --description "Create a snapshot of all currently installed Homebrew, Cask, Mac App Store, and WhaleBrew installations" + cd ~/.dotfiles/ + brew bundle dump --describe -f +end diff --git a/fish/functions/homebrew-restore.fish b/fish/functions/homebrew-restore.fish new file mode 100644 index 0000000..235327f --- /dev/null +++ b/fish/functions/homebrew-restore.fish @@ -0,0 +1,3 @@ +function homebrewRestore --description "Install all Homebrew, Cask, Mac App Store, and WhaleBrew applications from a snapshot" + brew bundle --file ~/.dotfiles/Brewfile +end diff --git a/fish/functions/replace-kitty-logo.fish b/fish/functions/replace-kitty-logo.fish new file mode 100644 index 0000000..bdc79d0 --- /dev/null +++ b/fish/functions/replace-kitty-logo.fish @@ -0,0 +1,5 @@ +function replaceKittyLogo --description "Set a different icon for Kitty terminal" + cp ~/Dropbox/Software/Kitty/kitty-icon/kitty-dark.icns /Applications/kitty.app/Contents/Resources/kitty.icns + rm /var/folders/*/*/*/com.apple.dock.iconcache + killall Dock +end diff --git a/fish/functions/update.fish b/fish/functions/update.fish new file mode 100644 index 0000000..f07caef --- /dev/null +++ b/fish/functions/update.fish @@ -0,0 +1,10 @@ +function update --description "Updating Homebrew, Ruby, Python, Node.js, Neovim, and MacOS" + brew update && brew outdated && brew upgrade && brew cleanup + sudo gem update --system && sudo gem update && gem cleanup all + pip install --upgrade pip + pip list -o --format columns | cut -d' ' -f1 | xargs -n1 pip install -U + npm update npm -g + npm update -g + nvim --headless "+Lazy! update" +qa + sudo softwareupdate -i -a +end