Skip to content

Commit 43e6a25

Browse files
committed
fix: correct validator messages and init command reference (#11, #12)
1 parent 2289c44 commit 43e6a25

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
@@ -97,7 +97,7 @@ export function initCommand(program: Command): void {
9797
console.log(chalk.blue('\n🔧 Next steps:'));
9898
console.log(chalk.gray(' 1. Review and customize the generated config file'));
9999
console.log(chalk.gray(' 2. Add descriptions, targets, and other configurations'));
100-
console.log(chalk.gray(' 3. Use "envx clone" to sync with your .env file'));
100+
console.log(chalk.gray(' 3. Use "envx load --all" to load variables from database'));
101101
console.log(chalk.gray(' 4. Use "envx export" to generate environment variables'));
102102
}
103103

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)