Skip to content

Commit

Permalink
fix: description key not found exception
Browse files Browse the repository at this point in the history
  • Loading branch information
roose committed Feb 20, 2017
1 parent dc06426 commit b626ad3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions npms.nim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ proc parsePackage(n: JsonNode): tuple[title, desc, url: string] =
username = p["publisher"]["username"].getStr
links = p["links"]
var
url, flags = ""
desc, url, flags = ""

if n.hasKey("flags"):
flags = " [" & join(lc[ y.key | ( y <- n["flags"].pairs ), string ], ", ") & "]"
Expand All @@ -19,8 +19,11 @@ proc parsePackage(n: JsonNode): tuple[title, desc, url: string] =
else:
url = links["npm"].getStr

let
if p.hasKey("description"):
desc =join(p["description"].getStr.split(), " ")

let
# desc =join(p["description"].getStr.split(), " ")
title = name & " v" & version & " by " & username & flags

return (title, desc, url)
Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"Name": "npms search",
"Description": "Search for npm packages with npms.io",
"Author": "roose",
"Version": "0.1.0",
"Version": "0.1.1",
"Language": "executable",
"Website": "https://github.com/roose/wox-npms-search",
"IcoPath": "Images\\npms.png",
Expand Down

0 comments on commit b626ad3

Please sign in to comment.