Skip to content

Commit 553acd2

Browse files
committed
fix: runtime errors
1 parent 356f3ba commit 553acd2

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

.suite-cli/cli/scripts/scripts.module.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,8 @@ const installDepsAtWorkspace = ({ workspace_name, workspace_directory = 'microse
166166
};
167167

168168
exec(command, options, (err, stdout, stderr) => {
169-
const split_stack = err.stack.split('\n')[1].split(sep)
170169
if (err) {
170+
const split_stack = err.stack.split('\n')[1].split(sep)
171171
if (split_stack[split_stack.length - 1].split([':']).includes('undefined')) { reject('Workspace name not provided!') }
172172
else {
173173
reject(err.stack.split('\n')[1]); // Extracting the first line of the stack trace
@@ -208,13 +208,12 @@ const addDepsAtWorkspace = ({ workspace_name, workspace_directory = 'microservic
208208
};
209209

210210
exec(command, options, (err, stdout, stderr) => {
211-
const split_stack = err.stack.split('\n')[1].split(sep)
212211
if (err) {
212+
const split_stack = err.stack.split('\n')[1].split(sep)
213213
if (split_stack[split_stack.length - 1].split([':']).includes('undefined')) { reject('Workspace name not provided!') }
214214
const errorMessage = stderr || err.message;
215215
const packageNameRegex = /\/([^/:]+):/;
216216
const match = packageNameRegex.exec(errorMessage);
217-
console.log(split_stack[split_stack.length - 1].split([':']).includes('undefined'))
218217
if (match && match[1]) {
219218
reject(`Package not found in registry: ${match[1]}`);
220219

0 commit comments

Comments
 (0)