Skip to content

Commit

Permalink
fix: ci test
Browse files Browse the repository at this point in the history
  • Loading branch information
chengcyber committed Oct 22, 2024
1 parent 8abbddc commit 9d60c20
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions apps/sparo-lib/src/cli/commands/list-profiles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ export class ListProfilesCommand implements ICommand<IListProfilesCommandOptions
.join(' ')} `;
let res: { projects: IProject[] } | undefined;
const resultString: string = childProcess.execSync(rushListCmd).toString();
const firstOpenBraceIndex: number = resultString.indexOf('{');
try {
res = JSON.parse(resultString);
res = JSON.parse(resultString.slice(firstOpenBraceIndex));
} catch (e) {
throw new Error(
`Parse json result from ${rushListCmd} failed.\nError: ${e.message}\nrush returns:\n${resultString}\n`
`Parse json result from "${rushListCmd}" failed.\nError: ${e.message}\nrush returns:\n${resultString}\n`
);
}
if (res) {
Expand Down

0 comments on commit 9d60c20

Please sign in to comment.