All files / packages/sds-release-manager/src index.ts

0% Statements 0/8
100% Branches 0/0
0% Functions 0/2
0% Lines 0/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26                                                   
#!/usr/bin/env node
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import { Command } from 'commander';
import { bumpBazelPinCommand } from './commands/bump-bazel-pin.js';
import { runCommand } from './run-command.js';
 
const packageJsonPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..', 'package.json');
const { version } = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')) as { version: string };
 
const program = new Command();
 
program.name('sds-release-manager').description('CLI for SDS release playbooks').version(version);
 
program
  .command('bump-bazel-pin')
  .description('Bump slds-scs Bazel pin on gitcore via GitHub APIs')
  .requiredOption('--pr <url-or-number>', 'aura/slds-scs PR URL or number')
  .option('--dry-run', 'run live reads; skip branch create, commit, and PR create', false)
  .action(async (opts: { pr: string; dryRun?: boolean }) => {
    await runCommand(() => bumpBazelPinCommand(opts));
  });
 
await program.parseAsync(process.argv);