From ceb17f375bec6c8e1238b6b725250617ea7bdf3e Mon Sep 17 00:00:00 2001 From: zhi Date: Thu, 5 Mar 2026 11:13:49 +0000 Subject: [PATCH] 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 --- install.mjs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/install.mjs b/install.mjs index c6bdf48..fea9108 100755 --- a/install.mjs +++ b/install.mjs @@ -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');