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