• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

panates / rman / 21286110491

23 Jan 2026 12:26PM UTC coverage: 0.0%. Remained the same
21286110491

push

github

erayhanoglu
0.37.3

0 of 23 branches covered (0.0%)

Branch coverage included in aggregate %.

0 of 1999 relevant lines covered (0.0%)

0.0 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/cli.ts
1
import colors from 'ansi-colors';
×
2
import { getDirname } from 'cross-dirname';
×
3
import fs from 'fs';
×
4
import logger from 'npmlog';
×
5
import path from 'path';
×
6
import yargs from 'yargs';
×
7
import { BuildCommand } from './commands/build-command.js';
×
8
import { ChangedCommand } from './commands/changed-command.js';
×
9
import { CleanInstallCommand } from './commands/ci-command.js';
×
10
import { ExecuteCommand } from './commands/execute-command.js';
×
11
import { InfoCommand } from './commands/info-command.js';
×
12
import { ListCommand } from './commands/list-command.js';
×
13
import { PublishCommand } from './commands/publish-command.js';
×
14
import { RunCommand } from './commands/run-command.js';
×
15
import { VersionCommand } from './commands/version-command.js';
×
16
import { Command } from './core/command.js';
×
17
import { Repository } from './core/repository.js';
×
18

×
19
export async function runCli(options?: { argv?: string[]; cwd?: string }) {
×
20
  try {
×
21
    let s = path.resolve(getDirname(), './package.json');
×
22
    if (!fs.existsSync(s)) {
×
23
      s = path.resolve(getDirname(), '../package.json');
×
24
    }
×
25
    const pkgJson = JSON.parse(fs.readFileSync(s, 'utf-8'));
×
26
    const repository = Repository.create(options?.cwd);
×
27
    const _argv = options?.argv || process.argv.slice(2);
×
28

×
29
    const globalKeys = Object.keys(Command.globalOptions).concat(['help', 'version']);
×
30

×
31
    const program = yargs(_argv)
×
32
      // .scriptName('rman')
×
33
      .strict()
×
34
      .version(pkgJson.version || '')
×
35
      .alias('version', 'v')
×
36
      .usage('$0 <cmd> [options...]')
×
37
      .help('help')
×
38
      .alias('help', 'h')
×
39
      .showHelpOnFail(false, 'Run with --help for available options')
×
40
      .fail((msg: any, err: any) => {
×
41
        if (!err?.logged) {
×
42
          const text = msg
×
43
            ? msg + '\n\n' + colors.whiteBright('Run with --help for available options')
×
44
            : err
×
45
              ? err.message
×
46
              : '';
×
47
          console.log('\n' + colors.red(text));
×
48
          throw msg;
×
49
        } else process.exit(1);
×
50
      })
×
51
      // group options under "Global Options:" header
×
52
      .options(Command.globalOptions)
×
53
      .group(globalKeys, 'Global Options:');
×
54

×
55
    InfoCommand.initCli(repository, program);
×
56
    ListCommand.initCli(repository, program);
×
57
    ChangedCommand.initCli(repository, program);
×
58
    ExecuteCommand.initCli(repository, program);
×
59
    RunCommand.initCli(repository, program);
×
60
    VersionCommand.initCli(repository, program);
×
61
    PublishCommand.initCli(repository, program);
×
62
    CleanInstallCommand.initCli(repository, program);
×
63
    BuildCommand.initCli(repository, program);
×
64

×
65
    if (!_argv.length) program.showHelp();
×
66
    else await program.parseAsync().catch(() => process.exit(1));
×
67
  } catch (e: any) {
×
68
    logger.error('rman', e);
×
69
  }
×
70
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc