Skip to content

Commit

Permalink
fix: single svgs download
Browse files Browse the repository at this point in the history
  • Loading branch information
sujjeee committed Aug 21, 2024
1 parent 85f1a3f commit 5ae9150
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "svgls",
"version": "0.0.12",
"version": "0.0.13",
"description": "a beautiful library with svg logos.",
"publishConfig": {
"access": "public"
Expand Down
7 changes: 7 additions & 0 deletions src/commands/add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ export const add = new Command()
let selectedSvgs = options.all
? availableSvgs.map((svgs) => svgs.route)
: options.svgs
?.map((svgName) => {
const svg = availableSvgs.find(
(item) => item.title.toLowerCase() === svgName.toLowerCase()
)
return svg ? svg.route : null
})
.filter((route) => route !== null)

if (!options.svgs?.length && !options.all) {
const { svgs } = await prompts({
Expand Down

0 comments on commit 5ae9150

Please sign in to comment.