A few updates, cleanup updated weather module.
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
#!/usr/bin/env bash
|
||||
[ -f functions.sh ] && source functions.sh
|
||||
|
||||
units="$(command -v units)"
|
||||
# Dependencies required by this module
|
||||
dependencies=("units")
|
||||
|
||||
shift
|
||||
chan="$1"
|
||||
shift
|
||||
if [ -z "$units" ]; then
|
||||
msg "$chan" "I do not have access to units."
|
||||
else
|
||||
msg "$chan" "$($units -v ${*#* } | head -n1 | tr -d '[:space:]')"
|
||||
|
||||
# Check dependencies before running
|
||||
if ! check_dependencies "${dependencies[@]}"; then
|
||||
msg "$chan" "$1: This module requires: ${dependencies[*]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
msg "$chan" "$(units -v ${*#* } | head -n1 | tr -d '[:space:]')"
|
||||
|
||||
Reference in New Issue
Block a user