@xcelera/cli 2.2.0 → 2.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -9303,23 +9303,21 @@ async function isGitRepository() {
9303
9303
  return simpleGit().checkIsRepo();
9304
9304
  }
9305
9305
  async function getCommit(hash = 'HEAD') {
9306
- // format: %H: commit hash, %s: subject, %an: author name, %ae: author email, %ai: author date
9306
+ // format: %H: commit hash, %s: subject, %an: author name, %ai: author date
9307
+ // Use null byte (%x00) as delimiter - cannot appear in commit data
9307
9308
  const commit = await simpleGit().show([
9308
9309
  hash,
9309
9310
  '--no-patch',
9310
- '--format=%H|%s|%an|%ae|%ai'
9311
+ '--format=%H%x00%s%x00%an%x00%ai'
9311
9312
  ]);
9312
- const [resolvedHash, message, author_name, author_email, date] = commit
9313
- .trim()
9314
- .split('|');
9313
+ const [resolvedHash, message, author_name, date] = commit.trim().split('\0');
9315
9314
  if (!resolvedHash) {
9316
9315
  throw new Error(`No commit found for ${hash}`);
9317
9316
  }
9318
9317
  return {
9319
9318
  hash: resolvedHash,
9320
9319
  message: message,
9321
- author: author_name || 'Unknown',
9322
- email: author_email || '',
9320
+ author: author_name || 'Unknown Author',
9323
9321
  date: date ? new Date(date).toISOString() : new Date().toISOString()
9324
9322
  };
9325
9323
  }
@@ -9376,6 +9374,10 @@ async function runAuditCommand(url, token) {
9376
9374
  catch (error) {
9377
9375
  const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
9378
9376
  errors.push(`❌ ${errorMessage}`);
9377
+ if (error instanceof Error && error.stack) {
9378
+ errors.push('');
9379
+ errors.push(error.stack);
9380
+ }
9379
9381
  return { exitCode: 1, output, errors };
9380
9382
  }
9381
9383
  }