worktree-launcher 1.1.0 → 1.2.0
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.
|
@@ -132,6 +132,10 @@ async function findWorktree(identifier) {
|
|
|
132
132
|
(wt) => wt.branch === identifier || wt.path === identifier || path.basename(wt.path) === identifier || wt.path.endsWith(identifier)
|
|
133
133
|
);
|
|
134
134
|
}
|
|
135
|
+
async function pushBranch(branchName, cwd) {
|
|
136
|
+
const args = ["push", "-u", "origin", branchName];
|
|
137
|
+
await execFileAsync("git", args, cwd ? { cwd } : void 0);
|
|
138
|
+
}
|
|
135
139
|
|
|
136
140
|
// src/utils/env.ts
|
|
137
141
|
import { glob } from "glob";
|
|
@@ -300,6 +304,15 @@ Creating worktree for branch: ${chalk.bold(branchName)}`));
|
|
|
300
304
|
console.error(chalk.red(error.message || error));
|
|
301
305
|
process.exit(1);
|
|
302
306
|
}
|
|
307
|
+
if (options.push) {
|
|
308
|
+
const pushSpinner = ora("Pushing branch to remote...").start();
|
|
309
|
+
try {
|
|
310
|
+
await pushBranch(branchName, worktreePath);
|
|
311
|
+
pushSpinner.succeed(chalk.green(`Pushed ${branchName} to origin`));
|
|
312
|
+
} catch (error) {
|
|
313
|
+
pushSpinner.fail(chalk.yellow(`Could not push: ${error.message}`));
|
|
314
|
+
}
|
|
315
|
+
}
|
|
303
316
|
const envSpinner = ora("Copying .env files...").start();
|
|
304
317
|
try {
|
|
305
318
|
const copiedFiles = await copyEnvFiles(mainRepoPath, worktreePath);
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
removeWorktree,
|
|
15
15
|
selectAITool,
|
|
16
16
|
selectMultiple
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-KGMGW33P.js";
|
|
18
18
|
|
|
19
19
|
// src/index.ts
|
|
20
20
|
import { Command } from "commander";
|
|
@@ -320,7 +320,7 @@ async function handleNewWorktree(mainRepoPath) {
|
|
|
320
320
|
}
|
|
321
321
|
]);
|
|
322
322
|
if (!branchName.trim()) return;
|
|
323
|
-
const { newCommand: newCommand2 } = await import("./new-
|
|
323
|
+
const { newCommand: newCommand2 } = await import("./new-DHGI74HT.js");
|
|
324
324
|
await newCommand2(branchName.trim(), { skipLaunch: false });
|
|
325
325
|
}
|
|
326
326
|
async function handleWorktreeActions(wt, mainRepoPath) {
|
|
@@ -424,13 +424,14 @@ async function pause() {
|
|
|
424
424
|
|
|
425
425
|
// src/index.ts
|
|
426
426
|
var program = new Command();
|
|
427
|
-
program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.
|
|
427
|
+
program.name("wt").description("CLI tool to streamline git worktrees with AI coding assistants").version("1.2.0").action(async () => {
|
|
428
428
|
await interactiveCommand();
|
|
429
429
|
});
|
|
430
|
-
program.command("new <branch-name>").description("Create a new worktree and launch AI assistant").option("-i, --install", "Run package manager install after creating worktree").option("-s, --skip-launch", "Create worktree without launching AI assistant").action(async (branchName, options) => {
|
|
430
|
+
program.command("new <branch-name>").description("Create a new worktree and launch AI assistant").option("-i, --install", "Run package manager install after creating worktree").option("-s, --skip-launch", "Create worktree without launching AI assistant").option("-p, --push", "Push branch to remote (visible on GitHub)").action(async (branchName, options) => {
|
|
431
431
|
await newCommand(branchName, {
|
|
432
432
|
install: options.install,
|
|
433
|
-
skipLaunch: options.skipLaunch
|
|
433
|
+
skipLaunch: options.skipLaunch,
|
|
434
|
+
push: options.push
|
|
434
435
|
});
|
|
435
436
|
});
|
|
436
437
|
program.command("list").alias("ls").description("List all worktrees for the current repository").action(async () => {
|