Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export function initCommand(program: Command): void {
console.log(chalk.blue('\n🔧 Next steps:'));
console.log(chalk.gray(' 1. Review and customize the generated config file'));
console.log(chalk.gray(' 2. Add descriptions, targets, and other configurations'));
console.log(chalk.gray(' 3. Use "envx clone" to sync with your .env file'));
console.log(chalk.gray(' 3. Use "envx load --all" to load variables from database'));
console.log(chalk.gray(' 4. Use "envx export" to generate environment variables'));
}

Expand Down
12 changes: 9 additions & 3 deletions src/utils/config/config-validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,15 @@ export class ConfigValidator {
errors.push('export 字段必须是布尔类型');
}

// clone 字段验证
if (config.files !== undefined && typeof config.files !== 'string') {
errors.push('clone 字段必须是字符串类型');
// files 字段验证
if (config.files !== undefined) {
if (Array.isArray(config.files)) {
if (!config.files.every((f: unknown) => typeof f === 'string')) {
errors.push('files 字段数组中的每个元素必须是字符串类型');
}
} else if (typeof config.files !== 'string') {
errors.push('files 字段必须是字符串或字符串数组类型');
}
}

// env 字段验证
Expand Down
Loading