Skip to content

Commit cbcbe9b

Browse files
authored
Merge pull request #233 from Exlint/EXL-185
fix: 🐞 change code and npm cli paths
2 parents 5ab4a14 + 8a13532 commit cbcbe9b

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

src/modules/use/helpers/vscode.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import util from 'node:util';
33
import { execFile, spawn } from 'node:child_process';
44

55
import fs from 'fs-extra';
6-
import envinfo from 'envinfo';
76

87
import { EXLINT_FOLDER_PATH } from '@/models/exlint-folder';
98
import type { IPolicyServer, IRecommendedPolicyServer } from '@/interfaces/policy';
@@ -92,13 +91,6 @@ export const installExtensions = async (libraries: string[]) => {
9291
'app',
9392
'bin',
9493
);
95-
} else {
96-
const vsCodeData = await envinfo.helpers.getVSCodeInfo();
97-
98-
if (vsCodeData[2]) {
99-
cwd = path.dirname(vsCodeData[2]);
100-
vsCodeCliCommandPath = path.basename(vsCodeData[2]);
101-
}
10294
}
10395

10496
await new Promise<void>((resolve, reject) => {

src/modules/use/utils/install-library.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import { execFile } from 'node:child_process';
22
import util from 'node:util';
33

4-
import envinfo from 'envinfo';
5-
64
import { EXLINT_FOLDER_PATH } from '@/models/exlint-folder';
75

86
import { INSTALLATION_TIMEOUT } from '../models/install-library';
@@ -22,13 +20,7 @@ export const installLibraries = async (libraryNames: string[]) => {
2220
transformedLibraryNames.push('stylelint-config-standard-scss');
2321
}
2422

25-
const npmInfo = await envinfo.helpers.getnpmInfo();
26-
27-
if (!npmInfo[2]) {
28-
throw new Error('Could not find NPM');
29-
}
30-
31-
await asyncExecFile(`"${npmInfo[2]}"`, ['i', '-D', ...transformedLibraryNames], {
23+
await asyncExecFile('npm', ['i', '-D', ...transformedLibraryNames], {
3224
cwd: EXLINT_FOLDER_PATH,
3325
timeout: INSTALLATION_TIMEOUT,
3426
shell: true,

0 commit comments

Comments
 (0)