@chrysb/alphaclaw 0.1.21 → 0.1.22
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 +5 -21
- package/package.json +1 -1
package/bin/alphaclaw.js
CHANGED
|
@@ -106,36 +106,20 @@ 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]
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// ---------------------------------------------------------------------------
|
|
129
|
-
// 5. Symlink <root>/.env -> ~/data/.env when available
|
|
130
|
-
// ---------------------------------------------------------------------------
|
|
131
|
-
|
|
132
|
-
try {
|
|
133
|
-
if (!fs.existsSync(envFilePath) && fs.existsSync(sharedEnvFilePath)) {
|
|
134
|
-
fs.symlinkSync(sharedEnvFilePath, envFilePath);
|
|
135
|
-
console.log(`[alphaclaw] Symlinked ${envFilePath} -> ${sharedEnvFilePath}`);
|
|
136
|
-
}
|
|
137
|
-
} catch (e) {
|
|
138
|
-
console.log(`[alphaclaw] .env symlink skipped: ${e.message}`);
|
|
122
|
+
console.log(`[alphaclaw] .env setup skipped: ${e.message}`);
|
|
139
123
|
}
|
|
140
124
|
|
|
141
125
|
// ---------------------------------------------------------------------------
|