Skip to content

Commit 220ee96

Browse files
Fix add command (#8)
* fix add command * more fixes
1 parent 5275e39 commit 220ee96

File tree

7 files changed

+20
-125
lines changed

7 files changed

+20
-125
lines changed

.changeset/README.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

.changeset/config.json

Lines changed: 0 additions & 11 deletions
This file was deleted.

.github/workflows/publish.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# @c14mx/pix31
22

3+
## 1.0.7
4+
5+
### Patch Changes
6+
7+
- Fixing `add` command. Getting `Error: ENOENT: no such file or directory...`
8+
39
## 1.0.6
410

511
### Patch Changes
@@ -35,21 +41,3 @@
3541
### Patch Changes
3642

3743
- Removing npm org scope and updating docs
38-
39-
## 1.0.4
40-
41-
### Patch Changes
42-
43-
- fix publish.yml types and error
44-
45-
## 1.0.3
46-
47-
### Patch Changes
48-
49-
- More README updates
50-
51-
## 1.0.2
52-
53-
### Patch Changes
54-
55-
- Adding license and updating readme

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# pix31
22

3-
[![npm version](https://badge.fury.io/js/%40c14mx%2Fpix31.svg)](https://www.npmjs.com/package/@c14mx/pix31)
4-
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5-
63
A CLI to add [pixelarticons](https://pixelarticons.com/) to your React and React Native projects.
74

85
**Dependencies**

package.json

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,10 @@
1212
"dev": "tsc -w",
1313
"typecheck": "tsc --noEmit",
1414
"lint": "tsc --noEmit",
15-
"prepublishOnly": "npm run build",
16-
"changeset": "changeset",
17-
"version": "changeset version",
18-
"release": "npm run build && changeset publish --access public"
15+
"prepublishOnly": "npm run build"
1916
},
2017
"name": "pix31",
21-
"version": "1.0.6",
18+
"version": "1.0.7",
2219
"private": false,
2320
"main": "dist/index.js",
2421
"module": "dist/index.mjs",
@@ -42,7 +39,6 @@
4239
"terminal-link": "^3.0.0"
4340
},
4441
"devDependencies": {
45-
"@changesets/cli": "^2.28.1",
4642
"@types/commander": "^2.12.2",
4743
"@types/fs-extra": "^11.0.4",
4844
"@types/jest": "^29.0.0",

src/lib/utils.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,19 @@ ${componentName}.displayName = "${componentName}";
115115
}
116116

117117
export function getSvgFiles(): string[] {
118-
const cliDir = path.join(__dirname, "../..");
119-
const svgDir = path.join(cliDir, "pixelarticons");
118+
const packageRoot = path.join(__dirname, "..", "..");
119+
const svgDir = path.join(packageRoot, "pixelarticons");
120120

121-
return fs
122-
.readdirSync(svgDir)
123-
.filter((file) => file.endsWith(".svg"))
124-
.map((file) => path.join(svgDir, file));
121+
try {
122+
return fs
123+
.readdirSync(svgDir)
124+
.filter((file) => file.endsWith(".svg"))
125+
.map((file) => path.join(svgDir, file));
126+
} catch (error) {
127+
throw new Error(
128+
`Failed to find SVG files in ${svgDir}. Please ensure the package is installed correctly.`
129+
);
130+
}
125131
}
126132

127133
export function searchRelatedFileNames(query: string, fileNames: string[], limit = 3): string[] {

0 commit comments

Comments
 (0)