@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.
Files changed (2) hide show
  1. package/bin/alphaclaw.js +10 -12
  2. package/package.json +1 -1
package/bin/alphaclaw.js CHANGED
@@ -106,33 +106,31 @@ try {
106
106
  }
107
107
 
108
108
  // ---------------------------------------------------------------------------
109
- // 4. Ensure shared ~/data/.env exists (seed from template if missing)
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(sharedEnvFilePath) && fs.existsSync(templatePath)) {
120
- fs.mkdirSync(sharedDataDir, { recursive: true });
121
- fs.copyFileSync(templatePath, sharedEnvFilePath);
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] Shared .env setup skipped: ${e.message}`);
122
+ console.log(`[alphaclaw] .env setup skipped: ${e.message}`);
126
123
  }
127
124
 
128
125
  // ---------------------------------------------------------------------------
129
- // 5. Symlink <root>/.env -> ~/data/.env when available
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(envFilePath) && fs.existsSync(sharedEnvFilePath)) {
134
- fs.symlinkSync(sharedEnvFilePath, envFilePath);
135
- console.log(`[alphaclaw] Symlinked ${envFilePath} -> ${sharedEnvFilePath}`);
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}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chrysb/alphaclaw",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },