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

Merge pull request #105 from skelly37/main

dict.nu — bugfix
This commit is contained in:
JT 2021-11-06 19:43:16 +13:00 committed by GitHub
commit 59e4a5601e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 link = (build-string 'https://api.dictionaryapi.dev/api/v2/entries/en/' ($word|str find-replace ' ' '%20'))
let output = (fetch $link | let output = (fetch $link |
rename word) rename word)
let w = ($output.word | first)
if $output.word == "No Definitions Found" {echo $output.word} {echo $output |
if $w == "No Definitions Found" {echo $output.word} {echo $output |
get meanings.definitions | get meanings.definitions |
select definition example select definition example
} }