@jayfong/x-server 2.100.0 → 2.102.0
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/lib/_cjs/cli/cli.js +15 -1
- package/lib/cli/cli.js +15 -1
- package/package.json +1 -1
package/lib/_cjs/cli/cli.js
CHANGED
|
@@ -367,4 +367,18 @@ _yargs.default.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
367
367
|
alias: 'h',
|
|
368
368
|
describe: '渠道',
|
|
369
369
|
type: 'string'
|
|
370
|
-
}), deploy).
|
|
370
|
+
}), deploy).command('get-channel [file]', '获取渠道', _ => _.positional('file', {
|
|
371
|
+
describe: '写入文件',
|
|
372
|
+
type: 'string'
|
|
373
|
+
}), async argv => {
|
|
374
|
+
await _env_util.EnvUtil.withChannel({
|
|
375
|
+
cwd: process.cwd(),
|
|
376
|
+
channel: '_',
|
|
377
|
+
cb: async channel => {
|
|
378
|
+
if (channel && argv.file) {
|
|
379
|
+
await _fsExtra.default.writeFile(_path.default.join(process.cwd(), argv.file), channel);
|
|
380
|
+
}
|
|
381
|
+
console.log(channel || '');
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
}).parse();
|
package/lib/cli/cli.js
CHANGED
|
@@ -364,4 +364,18 @@ yargs.command('dev', '开始开发', _ => _.positional('index', {
|
|
|
364
364
|
alias: 'h',
|
|
365
365
|
describe: '渠道',
|
|
366
366
|
type: 'string'
|
|
367
|
-
}), deploy).
|
|
367
|
+
}), deploy).command('get-channel [file]', '获取渠道', _ => _.positional('file', {
|
|
368
|
+
describe: '写入文件',
|
|
369
|
+
type: 'string'
|
|
370
|
+
}), async argv => {
|
|
371
|
+
await EnvUtil.withChannel({
|
|
372
|
+
cwd: process.cwd(),
|
|
373
|
+
channel: '_',
|
|
374
|
+
cb: async channel => {
|
|
375
|
+
if (channel && argv.file) {
|
|
376
|
+
await fs.writeFile(path.join(process.cwd(), argv.file), channel);
|
|
377
|
+
}
|
|
378
|
+
console.log(channel || '');
|
|
379
|
+
}
|
|
380
|
+
});
|
|
381
|
+
}).parse();
|