pm
This file
Path
tests/fixtures/pm
44 lines · 1.4 KiB
Last changed by
Switching to esm-only (#2464)John Geebefore adoptionf4bd470
History of this fileTake it
1#!/usr/bin/env node23import * as path from 'node:path';4import { program } from '../../index.js';56program7 .version('0.0.1')8 .command('install [name]', 'install one or more packages')9 .alias('i')10 .command('search [query]', 'search with optional query')11 .alias('s')12 .command('cache', 'actions dealing with the cache')13 .alias('c')14 .command('echo', 'echo arguments')15 .command('list', 'list packages installed')16 .alias('lst')17 .command('listen', 'listen for supported signal events')18 .alias('l')19 .command('publish', 'publish or update package')20 .alias('p')21 .command('default', 'default command', { hidden: true, isDefault: true })22 .command('specifyInstall', 'specify install subcommand', {23 executableFile: 'pm-install',24 })25 .command('specifyPublish', 'specify publish subcommand', {26 executableFile: 'pm-publish',27 })28 .command('silent', 'silently succeed')29 .command('fail', 'exit with non-zero status code')30 .command('terminate', 'terminate due to signal');3132program33 .command('exit-override')34 .exitOverride((err) => {35 process.exit(err.exitCode);36 })37 .command('fail', 'exit with non-zero status code', {38 executableFile: path.join(import.meta.dirname, 'pm-fail.js'),39 })40 .command('terminate', 'terminate due to signal', {41 executableFile: path.join(import.meta.dirname, 'pm-terminate.js'),42 });4344program.parse(process.argv);