mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 07:07:46 +00:00
fixed a type-o in the weather script (#348)
This commit is contained in:
parent
62a3cd13e1
commit
6471266bd9
1 changed files with 3 additions and 3 deletions
|
@ -48,7 +48,7 @@ def get_location_by_ip [locIdx: int, token: string] {
|
||||||
fetch $url
|
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;
|
let span = (metadata $err).span;
|
||||||
error make {msg: $msg, label: {text: $label, start: $span.start, end: $span.end } }
|
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 URL_FORECAST = "http://api.openweathermap.org/data/2.5/forecast/daily"
|
||||||
let coords = (get_location_by_ip $locIdx $token)
|
let coords = (get_location_by_ip $locIdx $token)
|
||||||
if ($coords | length) > 1 {
|
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" {
|
if $units == "f" {
|
||||||
|
@ -308,6 +308,6 @@ def get_emoji_by_id [id] {
|
||||||
# HOW TO USE
|
# HOW TO USE
|
||||||
# put this in your config.nu file
|
# put this in your config.nu file
|
||||||
# use /path/to/get-weather.nu get_weather
|
# use /path/to/get-weather.nu get_weather
|
||||||
#
|
#
|
||||||
# then from the nushell commmand prompt type
|
# then from the nushell commmand prompt type
|
||||||
# get_weather
|
# get_weather
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue