lalph 0.1.25 → 0.1.26
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/cli.mjs +9 -4
- package/package.json +1 -1
- package/src/Runner.ts +13 -10
- package/src/Worktree.ts +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -140235,7 +140235,7 @@ var Worktree = class extends Service()("lalph/Worktree", { make: gen(function* (
|
|
|
140235
140235
|
}));
|
|
140236
140236
|
yield* make$21`git worktree add ${directory} -d HEAD`.pipe(exitCode);
|
|
140237
140237
|
yield* fs.makeDirectory(pathService.join(directory, ".lalph"), { recursive: true });
|
|
140238
|
-
const setupPath = pathService.resolve(
|
|
140238
|
+
const setupPath = pathService.resolve(".lalph-setup.sh");
|
|
140239
140239
|
if (yield* fs.exists(setupPath)) yield* make$21({
|
|
140240
140240
|
cwd: directory,
|
|
140241
140241
|
extendEnv: true,
|
|
@@ -140376,7 +140376,12 @@ const run = fnUntraced(function* (options) {
|
|
|
140376
140376
|
const promptGen = yield* PromptGen;
|
|
140377
140377
|
const cliAgent = yield* getOrSelectCliAgent;
|
|
140378
140378
|
const prd = yield* Prd;
|
|
140379
|
-
|
|
140379
|
+
const exec = (template, ...args$1) => make$21({
|
|
140380
|
+
cwd: worktree.directory,
|
|
140381
|
+
extendEnv: true,
|
|
140382
|
+
env: cliAgent.env
|
|
140383
|
+
})(template, ...args$1).pipe(exitCode);
|
|
140384
|
+
if (isSome(options.targetBranch)) yield* exec`git checkout ${`origin/${options.targetBranch.value}`}`;
|
|
140380
140385
|
const chooseCommand = cliAgent.command({
|
|
140381
140386
|
prompt: promptGen.promptChoose,
|
|
140382
140387
|
prdFilePath: pathService.join(".lalph", "prd.yml")
|
|
@@ -140431,8 +140436,8 @@ const run = fnUntraced(function* (options) {
|
|
|
140431
140436
|
issueId: task.id
|
|
140432
140437
|
});
|
|
140433
140438
|
else if (options.autoMerge) for (const pr of prs) {
|
|
140434
|
-
if (isSome(options.targetBranch)) yield*
|
|
140435
|
-
if ((yield*
|
|
140439
|
+
if (isSome(options.targetBranch)) yield* exec`gh pr edit ${pr.prNumber} --base ${options.targetBranch.value}`;
|
|
140440
|
+
if ((yield* exec`gh pr merge ${pr.prNumber} -sd`) !== 0) yield* prd.flagUnmergable({ issueId: pr.issueId });
|
|
140436
140441
|
}
|
|
140437
140442
|
}, onError(fnUntraced(function* () {
|
|
140438
140443
|
const prd = yield* Prd;
|
package/package.json
CHANGED
package/src/Runner.ts
CHANGED
|
@@ -30,10 +30,18 @@ export const run = Effect.fnUntraced(
|
|
|
30
30
|
const cliAgent = yield* getOrSelectCliAgent
|
|
31
31
|
const prd = yield* Prd
|
|
32
32
|
|
|
33
|
+
const exec = (
|
|
34
|
+
template: TemplateStringsArray,
|
|
35
|
+
...args: Array<string | number | boolean>
|
|
36
|
+
) =>
|
|
37
|
+
ChildProcess.make({
|
|
38
|
+
cwd: worktree.directory,
|
|
39
|
+
extendEnv: true,
|
|
40
|
+
env: cliAgent.env,
|
|
41
|
+
})(template, ...args).pipe(ChildProcess.exitCode)
|
|
42
|
+
|
|
33
43
|
if (Option.isSome(options.targetBranch)) {
|
|
34
|
-
yield*
|
|
35
|
-
ChildProcess.exitCode,
|
|
36
|
-
)
|
|
44
|
+
yield* exec`git checkout ${`origin/${options.targetBranch.value}`}`
|
|
37
45
|
}
|
|
38
46
|
|
|
39
47
|
const chooseCommand = cliAgent.command({
|
|
@@ -120,15 +128,10 @@ export const run = Effect.fnUntraced(
|
|
|
120
128
|
} else if (options.autoMerge) {
|
|
121
129
|
for (const pr of prs) {
|
|
122
130
|
if (Option.isSome(options.targetBranch)) {
|
|
123
|
-
yield*
|
|
124
|
-
ChildProcess.exitCode,
|
|
125
|
-
)
|
|
131
|
+
yield* exec`gh pr edit ${pr.prNumber} --base ${options.targetBranch.value}`
|
|
126
132
|
}
|
|
127
133
|
|
|
128
|
-
const exitCode =
|
|
129
|
-
yield* ChildProcess.make`gh pr merge ${pr.prNumber} -sd`.pipe(
|
|
130
|
-
ChildProcess.exitCode,
|
|
131
|
-
)
|
|
134
|
+
const exitCode = yield* exec`gh pr merge ${pr.prNumber} -sd`
|
|
132
135
|
if (exitCode !== 0) {
|
|
133
136
|
yield* prd.flagUnmergable({ issueId: pr.issueId })
|
|
134
137
|
}
|
package/src/Worktree.ts
CHANGED
|
@@ -23,7 +23,7 @@ export class Worktree extends ServiceMap.Service<Worktree>()("lalph/Worktree", {
|
|
|
23
23
|
recursive: true,
|
|
24
24
|
})
|
|
25
25
|
|
|
26
|
-
const setupPath = pathService.resolve(
|
|
26
|
+
const setupPath = pathService.resolve(".lalph-setup.sh")
|
|
27
27
|
if (yield* fs.exists(setupPath)) {
|
|
28
28
|
yield* ChildProcess.make({
|
|
29
29
|
cwd: directory,
|