Skip to content

Commit

Permalink
change the installation command
Browse files Browse the repository at this point in the history
  • Loading branch information
cs-raj committed Nov 18, 2024
1 parent f96a4be commit 3913b29
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 25 deletions.
66 changes: 48 additions & 18 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/contentstack-migration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ $ npm install -g @contentstack/cli-migration
$ csdx COMMAND
running command...
$ csdx (--version)
@contentstack/cli-migration/1.6.3 darwin-arm64 node-v22.2.0
@contentstack/cli-migration/1.6.4 darwin-arm64 node-v22.8.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-migration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/cli-migration",
"version": "1.6.3",
"version": "1.6.4",
"author": "@contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
Expand Down
7 changes: 4 additions & 3 deletions packages/contentstack-migration/src/utils/modules.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const fs = require('fs');
const { execFileSync } = require('child_process');
const { spawnSync } = require('child_process');
const path = require('path');
const { sanitizePath } = require('@contentstack/cli-utilities');
const os = require('os');
Expand Down Expand Up @@ -72,7 +72,9 @@ function executeShellCommand(command, directory = '') {
try {
if (command.startsWith('npm i')) {
const [cmd, ...args] = command.split(' ');
execFileSync(cmd, args, { stdio: 'inherit', cwd: directory });
const result = spawnSync(cmd, args, { stdio: 'inherit', cwd: directory, shell: true });

if (result.error) throw result.error;
console.log(`Command executed successfully: ${command}`);
} else {
console.log(`Command should only be 'npm i <package-name>'`);
Expand All @@ -81,7 +83,6 @@ function executeShellCommand(command, directory = '') {
console.error(`Command execution failed. Error: ${error.message}`);
}
}

async function installModules(filePath, multiple) {
const files = multiple ? [] : [path.basename(filePath)];
const dirPath = multiple ? filePath : path.dirname(filePath);
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@contentstack/cli-command": "~1.3.2",
"@contentstack/cli-config": "~1.8.0",
"@contentstack/cli-launch": "~1.2.3",
"@contentstack/cli-migration": "~1.6.3",
"@contentstack/cli-migration": "~1.6.4",
"@contentstack/cli-utilities": "~1.8.0",
"@contentstack/management": "~1.18.3",
"@contentstack/cli-variants": "~1.1.2",
Expand Down
2 changes: 1 addition & 1 deletion pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3913b29

Please sign in to comment.