[zsh] Move the hello message to its own Darwin-specific say_hello function

This commit is contained in:
Eryn Wells 2022-05-25 15:10:08 -07:00
parent edf8034308
commit 3addd3d3a2
2 changed files with 15 additions and 8 deletions

View file

@ -5,11 +5,5 @@ if ssh-add --apple-load-keychain; then
echo
fi
if binary_exists sw_vers; then
cat_program=cat
if binary_exists lolcat; then
cat_program=lolcat
fi
print "It's `date +'%H:%M on %A, %B %d'`.\nThis machine is a $HWMODEL.\nYou're running macOS $OSVERSION.\n" | $cat_program
fi
autoload -Uz init_profile_darwin_say_hello
init_profile_darwin_say_hello

View file

@ -0,0 +1,13 @@
#!/usr/bin/env zsh
# Eryn Wells <eryn@erynwells.me>
if binary_exists sw_vers && [[ -n "$HWMODEL" && -n "$OSVERSION" ]]; then
cat_program=cat
if binary_exists lolcat; then
cat_program=lolcat
fi
print "It's `date +'%H:%M on %A, %B %d'`.\nThis machine is a $HWMODEL.\nYou're running macOS $OSVERSION.\n" | $cat_program
return 0
fi
return 1