mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 07:07:46 +00:00
dict.nu — bugfix
fixed coercion error that used to be thrown, when the column word contained more than one item. should be working fully correctly right now, feedback appreciated tho
This commit is contained in:
parent
ffc36c2b18
commit
3e0bdf088f
1 changed files with 3 additions and 2 deletions
|
@ -8,8 +8,9 @@ def dict [word: string] {
|
|||
let link = (build-string 'https://api.dictionaryapi.dev/api/v2/entries/en/' ($word|str find-replace ' ' '%20'))
|
||||
let output = (fetch $link |
|
||||
rename word)
|
||||
|
||||
if $output.word == "No Definitions Found" {echo $output.word} {echo $output |
|
||||
let w = ($output.word | first)
|
||||
|
||||
if $w == "No Definitions Found" {echo $output.word} {echo $output |
|
||||
get meanings.definitions |
|
||||
select definition example
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue