@jayfong/x-server 2.73.0 → 2.73.1
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 +0 -0
- package/lib/_cjs/cli/env_util.js +2 -2
- package/lib/cli/env_util.js +3 -3
- package/package.json +1 -1
package/lib/_cjs/cli/cli.js
CHANGED
|
File without changes
|
package/lib/_cjs/cli/env_util.js
CHANGED
|
@@ -11,7 +11,7 @@ var _vtils = require("vtils");
|
|
|
11
11
|
var _yaml = require("yaml");
|
|
12
12
|
class EnvUtil {
|
|
13
13
|
static async chooseChannel(cwd) {
|
|
14
|
-
const channelFiles = await (0, _globby.default)(['.env
|
|
14
|
+
const channelFiles = await (0, _globby.default)(['.env@*'], {
|
|
15
15
|
cwd: cwd,
|
|
16
16
|
onlyFiles: true,
|
|
17
17
|
absolute: false
|
|
@@ -19,7 +19,7 @@ class EnvUtil {
|
|
|
19
19
|
if (channelFiles.length === 0) {
|
|
20
20
|
return undefined;
|
|
21
21
|
}
|
|
22
|
-
const channels = channelFiles.map(channel => channel.split('@').pop().split('.')[0]);
|
|
22
|
+
const channels = (0, _vtils.uniq)(channelFiles.map(channel => channel.split('@').pop().split('.')[0]));
|
|
23
23
|
if (channels.length === 1) return channels[0];
|
|
24
24
|
const res = await _inquirer.default.prompt([{
|
|
25
25
|
name: 'channel',
|
package/lib/cli/env_util.js
CHANGED
|
@@ -2,11 +2,11 @@ import path from 'node:path';
|
|
|
2
2
|
import fs from 'fs-extra';
|
|
3
3
|
import globby from 'globby';
|
|
4
4
|
import inquirer from 'inquirer';
|
|
5
|
-
import { dedent, escapeRegExp, isPlainObject } from 'vtils';
|
|
5
|
+
import { dedent, escapeRegExp, isPlainObject, uniq } from 'vtils';
|
|
6
6
|
import { parse as yamlParse } from 'yaml';
|
|
7
7
|
export class EnvUtil {
|
|
8
8
|
static async chooseChannel(cwd) {
|
|
9
|
-
const channelFiles = await globby(['.env
|
|
9
|
+
const channelFiles = await globby(['.env@*'], {
|
|
10
10
|
cwd: cwd,
|
|
11
11
|
onlyFiles: true,
|
|
12
12
|
absolute: false
|
|
@@ -14,7 +14,7 @@ export class EnvUtil {
|
|
|
14
14
|
if (channelFiles.length === 0) {
|
|
15
15
|
return undefined;
|
|
16
16
|
}
|
|
17
|
-
const channels = channelFiles.map(channel => channel.split('@').pop().split('.')[0]);
|
|
17
|
+
const channels = uniq(channelFiles.map(channel => channel.split('@').pop().split('.')[0]));
|
|
18
18
|
if (channels.length === 1) return channels[0];
|
|
19
19
|
const res = await inquirer.prompt([{
|
|
20
20
|
name: 'channel',
|