fix: create OpenClaw config if not exists and simplify install summary
- Create ~/.openclaw/config.json if it doesn't exist - Automatically add plugin path to config - Simplify post-install steps (remove redundant 'add to profile' step)
This commit is contained in:
20
install.mjs
20
install.mjs
@@ -460,10 +460,14 @@ async function configure(env) {
|
||||
log('\n Updating OpenClaw plugin configuration...', 'blue');
|
||||
const openclawConfigPath = join(installDir, 'config.json');
|
||||
|
||||
if (existsSync(openclawConfigPath)) {
|
||||
try {
|
||||
let config = {};
|
||||
|
||||
// Load existing config if present
|
||||
if (existsSync(openclawConfigPath)) {
|
||||
const configContent = readFileSync(openclawConfigPath, 'utf8');
|
||||
const config = JSON.parse(configContent);
|
||||
config = JSON.parse(configContent);
|
||||
}
|
||||
|
||||
// Ensure plugins.load.paths exists
|
||||
if (!config.plugins) {
|
||||
@@ -487,9 +491,6 @@ async function configure(env) {
|
||||
}
|
||||
} catch (err) {
|
||||
logWarning(`Failed to update OpenClaw config: ${err.message}`);
|
||||
}
|
||||
} else {
|
||||
logWarning(`OpenClaw config not found at ${openclawConfigPath}`);
|
||||
log(' Please manually add the following to your OpenClaw config:', 'yellow');
|
||||
log(` plugins.load.paths: ["${join(installDir, 'skills', 'paddedcell')}"]`, 'cyan');
|
||||
}
|
||||
@@ -585,16 +586,13 @@ function printSummary(env) {
|
||||
|
||||
log('Next steps:', 'blue');
|
||||
console.log('');
|
||||
log('1. Add to your shell profile (~/.bashrc, ~/.zshrc):', 'yellow');
|
||||
log('1. Reload your shell or run:', 'yellow');
|
||||
log(` source ${join(installDir, 'paddedcell.env')}`, 'cyan');
|
||||
console.log('');
|
||||
log('2. Reload your shell or run:', 'yellow');
|
||||
log(` source ${join(installDir, 'paddedcell.env')}`, 'cyan');
|
||||
console.log('');
|
||||
log('3. Initialize pass_mgr (required before first use):', 'yellow');
|
||||
log('2. Initialize pass_mgr (required before first use):', 'yellow');
|
||||
log(' pass_mgr admin init', 'cyan');
|
||||
console.log('');
|
||||
log('4. Test pass_mgr:', 'yellow');
|
||||
log('3. Test pass_mgr:', 'yellow');
|
||||
log(' pass_mgr set test_key mypass # Set a test password', 'cyan');
|
||||
log(' pass_mgr get test_key # Retrieve password', 'cyan');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user