Skip to content

Commit

Permalink
fix: 🐞 change code and npm cli paths
Browse files Browse the repository at this point in the history
change code and npm cli paths
  • Loading branch information
tal-rofe committed Feb 23, 2023
1 parent e1d4880 commit 8a13532
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
8 changes: 0 additions & 8 deletions src/modules/use/helpers/vscode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import util from 'node:util';
import { execFile, spawn } from 'node:child_process';

import fs from 'fs-extra';
import envinfo from 'envinfo';

import { EXLINT_FOLDER_PATH } from '@/models/exlint-folder';
import type { IPolicyServer, IRecommendedPolicyServer } from '@/interfaces/policy';
Expand Down Expand Up @@ -92,13 +91,6 @@ export const installExtensions = async (libraries: string[]) => {
'app',
'bin',
);
} else {
const vsCodeData = await envinfo.helpers.getVSCodeInfo();

if (vsCodeData[2]) {
cwd = path.dirname(vsCodeData[2]);
vsCodeCliCommandPath = path.basename(vsCodeData[2]);
}
}

await new Promise<void>((resolve, reject) => {
Expand Down
10 changes: 1 addition & 9 deletions src/modules/use/utils/install-library.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { execFile } from 'node:child_process';
import util from 'node:util';

import envinfo from 'envinfo';

import { EXLINT_FOLDER_PATH } from '@/models/exlint-folder';

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

const npmInfo = await envinfo.helpers.getnpmInfo();

if (!npmInfo[2]) {
throw new Error('Could not find NPM');
}

await asyncExecFile(`"${npmInfo[2]}"`, ['i', '-D', ...transformedLibraryNames], {
await asyncExecFile('npm', ['i', '-D', ...transformedLibraryNames], {
cwd: EXLINT_FOLDER_PATH,
timeout: INSTALLATION_TIMEOUT,
shell: true,
Expand Down

0 comments on commit 8a13532

Please sign in to comment.