Commit d84f9c1
authored
fix(cli): fix tsgolint path resolution for yarn install (#360)
### What changed?
- Added `existsSync` import from `node:fs` to check if files exist
- Modified the tsgolint binary resolution logic to:
- First try to resolve from `oxlint-tsgolint/bin/tsgolint` for non-Windows platforms
- For Windows, attempt to find the binary in the local `node_modules/.bin` directory
- Add a fallback to the current working directory's `node_modules/.bin` if not found
- Simplified the environment variable assignment by moving the platform-specific logic to the path resolution
```bash
yarn lint
Failed to find tsgolint executable: OXLINT_TSGOLINT_PATH points to
'~/rollipop/node_modules/@voidzero-dev/vite-plus/node_modules/.bin/tsgolint'
which does not exist
```1 parent 4819622 commit d84f9c1
1 file changed
Lines changed: 18 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
43 | 53 | | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
47 | 57 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
| 58 | + | |
52 | 59 | | |
53 | 60 | | |
54 | 61 | | |
| |||
0 commit comments