Skip to content

Commit 3eff6ad

Browse files
committed
optional chaingin
1 parent fe871a5 commit 3eff6ad

File tree

1 file changed

+2
-2
lines changed
  • packages/contentstack-migration/src/utils

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,13 @@ function executeShellCommand(command, directory = '') {
7474
const [cmd, ...args] = command.split(' ');
7575
const result = spawnSync(cmd, args, { stdio: 'inherit', cwd: directory, shell: true });
7676

77-
if (result.error) throw result.error;
77+
if (result?.error) throw result.error;
7878
console.log(`Command executed successfully: ${command}`);
7979
} else {
8080
console.log(`Command should only be 'npm i <package-name>'`);
8181
}
8282
} catch (error) {
83-
console.error(`Command execution failed. Error: ${error.message}`);
83+
console.error(`Command execution failed. Error: ${error?.message}`);
8484
}
8585
}
8686
async function installModules(filePath, multiple) {

0 commit comments

Comments
 (0)