tb-dotfiles/home/.zshrc.d/weather.sh

17 lines
218 B
Bash
Executable file

#!/bin/bash
weather() {
if ! command -v wego &> /dev/null; then
return 1
fi
local -r LOCK_DATE="/tmp/wego-$(date '+%F-%H')"
if [ -e "${LOCK_DATE}" ]; then
return 0
fi
touch "${LOCK_DATE}"
wego
}
weather