fix: correct path construction in install script

- Fix duplicate .openclaw in env file path
- Use consistent installDir variable throughout
- Fix skills path in OpenClaw config update
- Fix fallback path in uninstall function
This commit is contained in:
zhi
2026-03-05 11:13:49 +00:00
parent 9ecb065b43
commit ceb17f375b

View File

@@ -440,16 +440,17 @@ async function configure(env) {
// Create environment config
log(' Creating environment configuration...', 'blue');
const installDir = env.openclawDir || join(homedir(), '.openclaw');
const envConfig = [
'# PaddedCell Environment Configuration',
`export PATH="${dirname(passMgrPath)}:$PATH"`,
'export PASS_MGR_PATH="pass_mgr"',
'',
'# PaddedCell skills',
`export PADDEDCELL_SKILLS_DIR="${join(env.openclawDir || homedir(), '.openclaw', 'skills', 'paddedcell')}"`,
`export PADDEDCELL_SKILLS_DIR="${join(installDir, 'skills', 'paddedcell')}"`,
].join('\n');
const envFile = join(env.openclawDir || homedir(), '.openclaw', 'paddedcell.env');
const envFile = join(installDir, 'paddedcell.env');
writeFileSync(envFile, envConfig);
logSuccess(`Environment config written to ${envFile}`);
@@ -458,7 +459,7 @@ async function configure(env) {
// Update OpenClaw plugins.load.paths configuration
log('\n Updating OpenClaw plugin configuration...', 'blue');
const openclawConfigPath = join(env.openclawDir || homedir(), '.openclaw', 'config.json');
const openclawConfigPath = join(installDir, 'config.json');
if (existsSync(openclawConfigPath)) {
try {
@@ -477,7 +478,7 @@ async function configure(env) {
}
// Add paddedcell skills path if not already present
const skillsPath = join(env.openclawDir || homedir(), '.openclaw', 'skills', 'paddedcell');
const skillsPath = join(installDir, 'skills', 'paddedcell');
if (!config.plugins.load.paths.includes(skillsPath)) {
config.plugins.load.paths.push(skillsPath);
writeFileSync(openclawConfigPath, JSON.stringify(config, null, 2));
@@ -491,7 +492,7 @@ async function configure(env) {
} else {
logWarning(`OpenClaw config not found at ${openclawConfigPath}`);
log(' Please manually add the following to your OpenClaw config:', 'yellow');
log(` plugins.load.paths: ["${join(env.openclawDir || homedir(), '.openclaw', 'skills', 'paddedcell')}"]`, 'cyan');
log(` plugins.load.paths: ["${join(installDir, 'skills', 'paddedcell')}"]`, 'cyan');
}
}
@@ -613,7 +614,7 @@ function printSummary(env) {
async function uninstall(env) {
logStep(1, 'Uninstalling PaddedCell...');
const installDir = options.prefix || env.openclawDir;
const installDir = options.prefix || env.openclawDir || join(homedir(), '.openclaw');
const binDir = join(installDir, 'bin');
const skillsDir = join(installDir, 'skills', 'paddedcell');
const envFile = join(installDir, 'paddedcell.env');