mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 07:07:46 +00:00
rename uses of update
to upsert
(#178)
This commit is contained in:
parent
8d713d030e
commit
834959daf7
2 changed files with 4 additions and 4 deletions
|
@ -3,14 +3,14 @@
|
|||
def "nu-complete cargo bins" [] {
|
||||
let $bins = (ls src | where name =~ bin | each { |f| ls -s $f.name } | flatten | where name =~ .rs || type == dir)
|
||||
if ($bins | length) > 0 {
|
||||
echo $bins | update name { |file| $file.name | str find-replace ".rs" "" } | get name
|
||||
echo $bins | upsert name { |file| $file.name | str find-replace ".rs" "" } | get name
|
||||
}
|
||||
}
|
||||
|
||||
def "nu-complete cargo examples" [] {
|
||||
let $examples = (ls | where name =~ examples | each { |f| ls -s $f.name } | flatten | where name =~ .rs || type == dir)
|
||||
if ($examples | length) > 0 {
|
||||
echo $examples | update name { |file| $file.name | str find-replace ".rs" "" } | get name
|
||||
echo $examples | upsert name { |file| $file.name | str find-replace ".rs" "" } | get name
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ def timed_weather_run [
|
|||
Source: "expired-cache"
|
||||
Emoji: ($emoji)
|
||||
}
|
||||
$weather_table | update last_run_time {(date now | date format '%Y-%m-%d %H:%M:%S %z')} | save $weather_runtime_file
|
||||
$weather_table | upsert last_run_time {(date now | date format '%Y-%m-%d %H:%M:%S %z')} | save $weather_runtime_file
|
||||
}
|
||||
} else {
|
||||
# $"Unable to find [($weather_runtime_file)], creating it(char nl)"
|
||||
|
@ -67,7 +67,7 @@ def timed_weather_run [
|
|||
Source: "initial"
|
||||
Emoji: ($emoji)
|
||||
}
|
||||
$weather_table | update last_run_time {(date now | date format '%Y-%m-%d %H:%M:%S %z')} | save $weather_runtime_file
|
||||
$weather_table | upsert last_run_time {(date now | date format '%Y-%m-%d %H:%M:%S %z')} | save $weather_runtime_file
|
||||
}
|
||||
} else {
|
||||
echo "Your command did not run because you are not on Windows..."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue