1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-01 22:57:46 +00:00

fixed a type-o in the weather script (#348)

This commit is contained in:
Darren Schroeder 2023-01-18 08:20:30 -06:00 committed by GitHub
parent 62a3cd13e1
commit 6471266bd9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -48,7 +48,7 @@ def get_location_by_ip [locIdx: int, token: string] {
fetch $url
}
def show-error [msg label err] { 07/02/2022 09:24:44 AM
def show-error [msg label err] {
let span = (metadata $err).span;
error make {msg: $msg, label: {text: $label, start: $span.start, end: $span.end } }
}
@ -61,7 +61,7 @@ def get_weather_by_ip [locIdx: int, units: string, token: string] {
let URL_FORECAST = "http://api.openweathermap.org/data/2.5/forecast/daily"
let coords = (get_location_by_ip $locIdx $token)
if ($coords | length) > 1 {
show-error "Error getting location" "There were more than one locations found" $coords
show-error "Error getting location" "There were more than one locations found" $coords
}
if $units == "f" {
@ -308,6 +308,6 @@ def get_emoji_by_id [id] {
# HOW TO USE
# put this in your config.nu file
# use /path/to/get-weather.nu get_weather
#
#
# then from the nushell commmand prompt type
# get_weather