Skip to content

Instantly share code, notes, and snippets.

@kuchida1981
Last active July 7, 2021 14:41
Show Gist options
  • Save kuchida1981/a19966194c99d64be207e56ae9668c1f to your computer and use it in GitHub Desktop.
Save kuchida1981/a19966194c99d64be207e56ae9668c1f to your computer and use it in GitHub Desktop.
fish shell 起動時にアップデート可能なパッケージ数を表示
function fish_greeting -d "What's up, fish?"
set_color $fish_color_autosuggestion
set new_packages (command checkupdates)
set new_packages_count (count $new_packages)
if [ $new_packages_count -gt 0 ]
if command echo $new_packages | command grep -q "\slinux\s[0-9]";
command echo (count $new_packages) packages can be upgraded. These packages require restarting system.
else
command echo (count $new_packages) packages can be upgraded.
end
end
set_color normal
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment