Skip to content

Commit 070162c

Browse files
committed
fixed semgrep issues
1 parent 40d53d5 commit 070162c

5 files changed

Lines changed: 75 additions & 81 deletions

File tree

package-lock.json

Lines changed: 21 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/contentstack-audit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
},
3232
"devDependencies": {
3333
"@contentstack/cli-dev-dependencies": "^1.2.4",
34-
"@oclif/test": "^4.1.0",
34+
"@oclif/test": "^4.1.2",
3535
"@types/chai": "^4.3.20",
3636
"@types/fs-extra": "^11.0.4",
3737
"@types/mocha": "^10.0.9",

packages/contentstack-migration/src/utils/modules.js

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,18 @@ function installDependencies(dependencies, directory) {
6161
if (!internalModules.has(dep)) {
6262
const pkg = dep.startsWith('@') ? dep : dep.split('/')[0];
6363
if (!installedDependencies.has(pkg)) {
64-
executeShellCommand(`npm i ${pkg}`, directory);
64+
executeShellCommand(pkg, directory);
6565
installedDependencies.add(pkg);
6666
}
6767
}
6868
});
6969
}
7070

71-
function executeShellCommand(command, directory = '') {
71+
function executeShellCommand(pkg, directory = '') {
7272
try {
73-
if (command.startsWith('npm i')) {
74-
const [cmd, ...args] = command.split(' ');
75-
const result = spawnSync(cmd, args, { stdio: 'inherit', cwd: directory, shell: true });
76-
77-
if (result?.error) throw result.error;
78-
console.log(`Command executed successfully: ${command}`);
79-
} else {
80-
console.log(`Command should only be 'npm i <package-name>'`);
81-
}
73+
const result = spawnSync(`npm`, ['i', pkg], { stdio: 'inherit', cwd: directory, shell: false });
74+
if (result?.error) throw result.error;
75+
console.log(`Command executed successfully: ${command}`);
8276
} catch (error) {
8377
console.error(`Command execution failed. Error: ${error?.message}`);
8478
}

packages/contentstack/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"@oclif/core": "^3.27.0",
4444
"@oclif/plugin-help": "^5",
4545
"@oclif/plugin-not-found": "^2.4.3",
46-
"@oclif/plugin-plugins": "^5.4.15",
46+
"@oclif/plugin-plugins": "^5.4.17",
4747
"chalk": "^4.1.2",
4848
"debug": "^4.3.7",
4949
"figlet": "^1.8.0",
@@ -55,7 +55,7 @@
5555
"winston": "^3.17.0"
5656
},
5757
"devDependencies": {
58-
"@oclif/test": "^4.1.0",
58+
"@oclif/test": "^4.1.2",
5959
"@types/chai": "^4.3.20",
6060
"@types/inquirer": "^9.0.7",
6161
"@types/mkdirp": "^1.0.2",

0 commit comments

Comments
 (0)