Skip to content

Commit 89d753f

Browse files
authored
Merge pull request #1682 from contentstack/fix/migration
change the installation command
2 parents 7fe493e + 3eff6ad commit 89d753f

File tree

6 files changed

+137
-99
lines changed

6 files changed

+137
-99
lines changed

package-lock.json

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

packages/contentstack-migration/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $ npm install -g @contentstack/cli-migration
2121
$ csdx COMMAND
2222
running command...
2323
$ csdx (--version)
24-
@contentstack/cli-migration/1.6.3 darwin-arm64 node-v22.8.0
24+
@contentstack/cli-migration/1.6.4 darwin-arm64 node-v22.8.0
2525
$ csdx --help [COMMAND]
2626
USAGE
2727
$ csdx COMMAND

packages/contentstack-migration/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/cli-migration",
3-
"version": "1.6.3",
3+
"version": "1.6.4",
44
"author": "@contentstack",
55
"bugs": "https://github.com/contentstack/cli/issues",
66
"dependencies": {

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const fs = require('fs');
2-
const { execFileSync } = require('child_process');
2+
const { spawnSync } = require('child_process');
33
const path = require('path');
44
const { sanitizePath } = require('@contentstack/cli-utilities');
55
const os = require('os');
@@ -72,16 +72,17 @@ function executeShellCommand(command, directory = '') {
7272
try {
7373
if (command.startsWith('npm i')) {
7474
const [cmd, ...args] = command.split(' ');
75-
execFileSync(cmd, args, { stdio: 'inherit', cwd: directory });
75+
const result = spawnSync(cmd, args, { stdio: 'inherit', cwd: directory, shell: true });
76+
77+
if (result?.error) throw result.error;
7678
console.log(`Command executed successfully: ${command}`);
7779
} else {
7880
console.log(`Command should only be 'npm i <package-name>'`);
7981
}
8082
} catch (error) {
81-
console.error(`Command execution failed. Error: ${error.message}`);
83+
console.error(`Command execution failed. Error: ${error?.message}`);
8284
}
8385
}
84-
8586
async function installModules(filePath, multiple) {
8687
const files = multiple ? [] : [path.basename(filePath)];
8788
const dirPath = multiple ? filePath : path.dirname(filePath);

packages/contentstack/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"@contentstack/cli-command": "~1.3.2",
3737
"@contentstack/cli-config": "~1.9.0",
3838
"@contentstack/cli-launch": "~1.3.0",
39-
"@contentstack/cli-migration": "~1.6.3",
39+
"@contentstack/cli-migration": "~1.6.4",
4040
"@contentstack/cli-utilities": "~1.8.0",
4141
"@contentstack/management": "~1.18.3",
4242
"@contentstack/cli-variants": "~1.1.2",

0 commit comments

Comments
 (0)