mirror of
https://github.com/bmadcode/BMAD-METHOD.git
synced 2025-12-17 09:45:25 +00:00
feat: default installer username to system user
This commit is contained in:
parent
073597a8ff
commit
617eacbfeb
@ -359,6 +359,25 @@ class ConfigCollector {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the default username from the system
|
||||||
|
* @returns {string} Capitalized username\
|
||||||
|
*/
|
||||||
|
getDefaultUsername() {
|
||||||
|
let result = 'BMad';
|
||||||
|
try {
|
||||||
|
const os = require('node:os');
|
||||||
|
const userInfo = os.userInfo();
|
||||||
|
if (userInfo && userInfo.username) {
|
||||||
|
const username = userInfo.username;
|
||||||
|
result = username.charAt(0).toUpperCase() + username.slice(1);
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// Do nothing, just return 'BMad'
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collect configuration for a single module
|
* Collect configuration for a single module
|
||||||
* @param {string} moduleName - Module name
|
* @param {string} moduleName - Module name
|
||||||
@ -604,6 +623,11 @@ class ConfigCollector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Special handling for user_name: default to system user
|
||||||
|
if (moduleName === 'core' && key === 'user_name' && !existingValue) {
|
||||||
|
item.default = this.getDefaultUsername();
|
||||||
|
}
|
||||||
|
|
||||||
// Determine question type and default value
|
// Determine question type and default value
|
||||||
let questionType = 'input';
|
let questionType = 'input';
|
||||||
let defaultValue = item.default;
|
let defaultValue = item.default;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user