Open welldan97 opened 8 years ago
Also I've made a small script:
#!/usr/bin/env bash
set -e
main() {
output=''
while ! does-include "$output" 'Latitude' ; do
output=$(whereami)
done
echo $(fetch "$output" 'Latitude') $(fetch "$output" 'Longitude')
}
fetch() {
echo "$1" | grep "$2" | head -n 1 | cut -d' ' -f2
}
does-include() {
echo "$1" | grep "$2" > /dev/null
}
main "$@"
It makes output more consistent - remove duplicates, keeps retrying till return results, and returns just latitude and longitude, i.e.:
$ w97-whereami
56.320956 44.027472
$ brew cask install whereami ==> Downloading https://github.com/robmathers/WhereAmI/releases/download/v1.02/whereami-1.02.zip ######################################################################## 100.0% ==> Verifying checksum for Cask whereami ==> Symlinking Binary 'whereami' to '/usr/local/bin/whereami' 🍺 whereami staged at '/opt/homebrew-cask/Caskroom/whereami/latest' (36K)
Now brew cask install
is deprecated; just use brew install
is okay. And tested on Apple Silicon with macOS 11.3, it works fine.
BTW, @welldan97 it warns me Warning: Unexpected method 'license' called on Cask whereami.
when I tapped your formula; probably you can fix that.
If anyone interested, you can install
robmathers/WhereAmI
via Homebrew cask by tapping welldan97/whereami: