1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | const command_1 = require("@oclif/command");
|
4 | const qq = require("qqjs");
|
5 | const Tarballs = require("../../tarballs");
|
6 | class Pack extends command_1.Command {
|
7 | async run() {
|
8 | const prevCwd = qq.cwd();
|
9 | if (process.platform === 'win32')
|
10 | throw new Error('pack does not function on windows');
|
11 | const { flags } = this.parse(Pack);
|
12 | const targets = flags.targets ? flags.targets.split(',') : undefined;
|
13 | const buildConfig = await Tarballs.buildConfig(flags.root, { xz: flags.xz, targets });
|
14 | await Tarballs.build(buildConfig);
|
15 | qq.cd(prevCwd);
|
16 | }
|
17 | }
|
18 | exports.default = Pack;
|
19 | Pack.description = `packages oclif cli into tarballs
|
20 |
|
21 | This can be used to create oclif CLIs that use the system node or that come preloaded with a node binary.
|
22 | `;
|
23 | Pack.flags = {
|
24 | root: command_1.flags.string({ char: 'r', description: 'path to oclif CLI root', default: '.', required: true }),
|
25 | targets: command_1.flags.string({ char: 't', description: 'comma-separated targets to pack (e.g.: linux-arm,win32-x64)' }),
|
26 | xz: command_1.flags.boolean({ description: 'also build xz', allowNo: true }),
|
27 | };
|