@chrysb/alphaclaw 0.1.21 → 0.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/alphaclaw.js +10 -12
- package/package.json +1 -1
package/bin/alphaclaw.js
CHANGED
|
@@ -106,33 +106,31 @@ try {
|
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
// ---------------------------------------------------------------------------
|
|
109
|
-
// 4. Ensure
|
|
109
|
+
// 4. Ensure <rootDir>/.env exists (seed from template if missing)
|
|
110
110
|
// ---------------------------------------------------------------------------
|
|
111
111
|
|
|
112
112
|
const envFilePath = path.join(rootDir, ".env");
|
|
113
|
-
const sharedDataDir = path.join(os.homedir(), "data");
|
|
114
|
-
const sharedEnvFilePath = path.join(sharedDataDir, ".env");
|
|
115
113
|
const setupDir = path.join(__dirname, "..", "lib", "setup");
|
|
116
114
|
const templatePath = path.join(setupDir, "env.template");
|
|
117
115
|
|
|
118
116
|
try {
|
|
119
|
-
if (!fs.existsSync(
|
|
120
|
-
fs.
|
|
121
|
-
|
|
122
|
-
console.log(`[alphaclaw] Created shared env at ${sharedEnvFilePath}`);
|
|
117
|
+
if (!fs.existsSync(envFilePath) && fs.existsSync(templatePath)) {
|
|
118
|
+
fs.copyFileSync(templatePath, envFilePath);
|
|
119
|
+
console.log(`[alphaclaw] Created env at ${envFilePath}`);
|
|
123
120
|
}
|
|
124
121
|
} catch (e) {
|
|
125
|
-
console.log(`[alphaclaw]
|
|
122
|
+
console.log(`[alphaclaw] .env setup skipped: ${e.message}`);
|
|
126
123
|
}
|
|
127
124
|
|
|
128
125
|
// ---------------------------------------------------------------------------
|
|
129
|
-
// 5. Symlink <
|
|
126
|
+
// 5. Symlink <rootDir>/.openclaw/.env -> <rootDir>/.env
|
|
130
127
|
// ---------------------------------------------------------------------------
|
|
131
128
|
|
|
129
|
+
const openclawEnvLink = path.join(openclawDir, ".env");
|
|
132
130
|
try {
|
|
133
|
-
if (!fs.existsSync(
|
|
134
|
-
fs.symlinkSync(
|
|
135
|
-
console.log(`[alphaclaw] Symlinked ${
|
|
131
|
+
if (!fs.existsSync(openclawEnvLink)) {
|
|
132
|
+
fs.symlinkSync(envFilePath, openclawEnvLink);
|
|
133
|
+
console.log(`[alphaclaw] Symlinked ${openclawEnvLink} -> ${envFilePath}`);
|
|
136
134
|
}
|
|
137
135
|
} catch (e) {
|
|
138
136
|
console.log(`[alphaclaw] .env symlink skipped: ${e.message}`);
|