@jayfong/x-server 2.98.1 → 2.99.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/env_util.js +3 -2
- package/lib/cli/env_util.js +3 -2
- package/package.json +1 -1
package/lib/_cjs/cli/env_util.js
CHANGED
|
@@ -108,7 +108,7 @@ class EnvUtil {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
static getFile(env, channel, noBase) {
|
|
111
|
-
const file = noBase ? [] : ['.env'];
|
|
111
|
+
const file = ['.env_meta', ...(noBase ? [] : ['.env'])];
|
|
112
112
|
if (!noBase && channel) {
|
|
113
113
|
file.push(`.env@${channel}`);
|
|
114
114
|
}
|
|
@@ -159,12 +159,13 @@ class EnvUtil {
|
|
|
159
159
|
const envItemMap = {};
|
|
160
160
|
const envValueMap = {};
|
|
161
161
|
for (const file of options.file) {
|
|
162
|
+
const isEnvMeta = file === '.env_meta';
|
|
162
163
|
const envYmlFile = _nodePath.default.join(options.cwd, `${file}.yml`);
|
|
163
164
|
const envYamlFile = _nodePath.default.join(options.cwd, `${file}.yaml`);
|
|
164
165
|
const envFile = (await _fsExtra.default.pathExists(envYmlFile)) ? envYmlFile : (await _fsExtra.default.pathExists(envYamlFile)) ? envYamlFile : '';
|
|
165
166
|
if (envFile) {
|
|
166
167
|
const envContent = await _fsExtra.default.readFile(envFile, 'utf-8');
|
|
167
|
-
EnvUtil.parseContent(envContent, envItemMap, envValueMap);
|
|
168
|
+
EnvUtil.parseContent(envContent, isEnvMeta ? undefined : envItemMap, envValueMap);
|
|
168
169
|
}
|
|
169
170
|
}
|
|
170
171
|
return Object.values(envItemMap);
|
package/lib/cli/env_util.js
CHANGED
|
@@ -103,7 +103,7 @@ export class EnvUtil {
|
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
105
|
static getFile(env, channel, noBase) {
|
|
106
|
-
const file = noBase ? [] : ['.env'];
|
|
106
|
+
const file = ['.env_meta', ...(noBase ? [] : ['.env'])];
|
|
107
107
|
if (!noBase && channel) {
|
|
108
108
|
file.push(`.env@${channel}`);
|
|
109
109
|
}
|
|
@@ -154,12 +154,13 @@ export class EnvUtil {
|
|
|
154
154
|
const envItemMap = {};
|
|
155
155
|
const envValueMap = {};
|
|
156
156
|
for (const file of options.file) {
|
|
157
|
+
const isEnvMeta = file === '.env_meta';
|
|
157
158
|
const envYmlFile = path.join(options.cwd, `${file}.yml`);
|
|
158
159
|
const envYamlFile = path.join(options.cwd, `${file}.yaml`);
|
|
159
160
|
const envFile = (await fs.pathExists(envYmlFile)) ? envYmlFile : (await fs.pathExists(envYamlFile)) ? envYamlFile : '';
|
|
160
161
|
if (envFile) {
|
|
161
162
|
const envContent = await fs.readFile(envFile, 'utf-8');
|
|
162
|
-
EnvUtil.parseContent(envContent, envItemMap, envValueMap);
|
|
163
|
+
EnvUtil.parseContent(envContent, isEnvMeta ? undefined : envItemMap, envValueMap);
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
166
|
return Object.values(envItemMap);
|