Skip to content

Commit bcefda2

Browse files
authored
Merge pull request #24 from leaperone/fix/issue-11-12-validator-and-init
fix: correct validator messages and init command reference
2 parents b680967 + 43e6a25 commit bcefda2

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

src/commands/init.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function initCommand(program: Command): void {
101101
console.log(chalk.blue('\n🔧 Next steps:'));
102102
console.log(chalk.gray(' 1. Review and customize the generated config file'));
103103
console.log(chalk.gray(' 2. Add descriptions, targets, and other configurations'));
104-
console.log(chalk.gray(' 3. Use "envx clone" to sync with your .env file'));
104+
console.log(chalk.gray(' 3. Use "envx load --all" to load variables from database'));
105105
console.log(chalk.gray(' 4. Use "envx export" to generate environment variables'));
106106
}
107107

src/utils/config/config-validator.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,15 @@ export class ConfigValidator {
5656
errors.push('export 字段必须是布尔类型');
5757
}
5858

59-
// clone 字段验证
60-
if (config.files !== undefined && typeof config.files !== 'string') {
61-
errors.push('clone 字段必须是字符串类型');
59+
// files 字段验证
60+
if (config.files !== undefined) {
61+
if (Array.isArray(config.files)) {
62+
if (!config.files.every((f: unknown) => typeof f === 'string')) {
63+
errors.push('files 字段数组中的每个元素必须是字符串类型');
64+
}
65+
} else if (typeof config.files !== 'string') {
66+
errors.push('files 字段必须是字符串或字符串数组类型');
67+
}
6268
}
6369

6470
// env 字段验证

0 commit comments

Comments
 (0)