@dezkareid/osddt 1.11.9 → 1.11.10
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/dist/index.js +23 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1302,6 +1302,27 @@ function startWorktreeCommand() {
|
|
|
1302
1302
|
return cmd;
|
|
1303
1303
|
}
|
|
1304
1304
|
|
|
1305
|
+
async function resolveWorkingDir(worktreePath, featureName) {
|
|
1306
|
+
const target = path.join('working-on', featureName);
|
|
1307
|
+
// Check root first (single repo)
|
|
1308
|
+
if (await fs.pathExists(path.join(worktreePath, target))) {
|
|
1309
|
+
return path.join(worktreePath, target);
|
|
1310
|
+
}
|
|
1311
|
+
// Search one level deep (monorepo packages)
|
|
1312
|
+
try {
|
|
1313
|
+
const entries = await fs.readdir(worktreePath);
|
|
1314
|
+
for (const entry of entries) {
|
|
1315
|
+
const candidate = path.join(worktreePath, entry, target);
|
|
1316
|
+
if (await fs.pathExists(candidate)) {
|
|
1317
|
+
return candidate;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
catch {
|
|
1322
|
+
// worktreePath not accessible — fall through to default
|
|
1323
|
+
}
|
|
1324
|
+
return path.join(worktreePath, target);
|
|
1325
|
+
}
|
|
1305
1326
|
async function runWorktreeInfo(featureName) {
|
|
1306
1327
|
const cwd = process.cwd();
|
|
1307
1328
|
const barePath = await resolveBarePath(cwd);
|
|
@@ -1334,7 +1355,8 @@ async function runWorktreeInfo(featureName) {
|
|
|
1334
1355
|
process.exit(1);
|
|
1335
1356
|
}
|
|
1336
1357
|
}
|
|
1337
|
-
|
|
1358
|
+
const workingDir = await resolveWorkingDir(entry.worktreePath, entry.featureName);
|
|
1359
|
+
console.log(JSON.stringify({ worktreePath: entry.worktreePath, workingDir, branch: entry.branch }));
|
|
1338
1360
|
}
|
|
1339
1361
|
function worktreeInfoCommand() {
|
|
1340
1362
|
const cmd = new Command('worktree-info');
|