jettypod 4.2.6 → 4.2.7
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/lib/worktree-manager.js +19 -1
- package/package.json +1 -1
package/lib/worktree-manager.js
CHANGED
|
@@ -177,7 +177,25 @@ async function createWorktree(workItem, options = {}) {
|
|
|
177
177
|
throw new Error(`Failed to create .jettypod symlink: ${symlinkErr.message}`);
|
|
178
178
|
}
|
|
179
179
|
|
|
180
|
-
// Step 5:
|
|
180
|
+
// Step 5: Symlink .env files from main repo
|
|
181
|
+
// Environment files are typically gitignored, so worktrees don't get them
|
|
182
|
+
try {
|
|
183
|
+
const envFiles = fs.readdirSync(gitRoot).filter(f => f.startsWith('.env'));
|
|
184
|
+
for (const envFile of envFiles) {
|
|
185
|
+
const envSource = path.join(gitRoot, envFile);
|
|
186
|
+
const envTarget = path.join(worktreePath, envFile);
|
|
187
|
+
|
|
188
|
+
// Only symlink if source is a file and target doesn't exist
|
|
189
|
+
if (fs.statSync(envSource).isFile() && !fs.existsSync(envTarget)) {
|
|
190
|
+
fs.symlinkSync(envSource, envTarget);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
} catch (envErr) {
|
|
194
|
+
// Non-fatal - log warning but continue
|
|
195
|
+
console.warn(`Warning: Could not symlink .env files: ${envErr.message}`);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// Step 6: Return the created worktree record
|
|
181
199
|
const worktree = await new Promise((resolve, reject) => {
|
|
182
200
|
db.get('SELECT * FROM worktrees WHERE id = ?', [worktreeId], (err, row) => {
|
|
183
201
|
if (err) reject(err);
|