@damper/cli 0.4.0 → 0.4.1
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 +1 -1
- package/dist/services/claude.js +35 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { startCommand } from './commands/start.js';
|
|
|
4
4
|
import { statusCommand } from './commands/status.js';
|
|
5
5
|
import { cleanupCommand } from './commands/cleanup.js';
|
|
6
6
|
import { setupCommand } from './commands/setup.js';
|
|
7
|
-
const VERSION = '0.4.
|
|
7
|
+
const VERSION = '0.4.1';
|
|
8
8
|
function showHelp() {
|
|
9
9
|
console.log(`
|
|
10
10
|
${pc.bold('@damper/cli')} - Agent orchestration for Damper tasks
|
package/dist/services/claude.js
CHANGED
|
@@ -236,21 +236,46 @@ export async function postTaskFlow(options) {
|
|
|
236
236
|
console.log(pc.dim('You have uncommitted changes. Commit them before pushing.\n'));
|
|
237
237
|
}
|
|
238
238
|
if (hasUnpushedCommits && !hasUncommittedChanges) {
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
const { select } = await import('@inquirer/prompts');
|
|
240
|
+
const mergeAction = await select({
|
|
241
|
+
message: 'How do you want to merge your changes?',
|
|
242
|
+
choices: [
|
|
243
|
+
{ name: 'Create a pull request', value: 'pr' },
|
|
244
|
+
{ name: 'Merge directly to main', value: 'merge' },
|
|
245
|
+
{ name: 'Just push (decide later)', value: 'push' },
|
|
246
|
+
{ name: 'Skip (keep local)', value: 'skip' },
|
|
247
|
+
],
|
|
242
248
|
});
|
|
243
|
-
if (
|
|
249
|
+
if (mergeAction === 'skip') {
|
|
250
|
+
console.log(pc.dim('Keeping changes local.\n'));
|
|
251
|
+
}
|
|
252
|
+
else if (mergeAction === 'merge') {
|
|
253
|
+
// Merge directly to main
|
|
254
|
+
try {
|
|
255
|
+
const { execa } = await import('execa');
|
|
256
|
+
console.log(pc.dim('Switching to main and merging...'));
|
|
257
|
+
// Fetch latest main
|
|
258
|
+
await execa('git', ['fetch', 'origin', 'main'], { cwd, stdio: 'pipe' });
|
|
259
|
+
// Checkout main in the main project root (not worktree)
|
|
260
|
+
await execa('git', ['checkout', 'main'], { cwd: projectRoot, stdio: 'pipe' });
|
|
261
|
+
// Merge the feature branch
|
|
262
|
+
await execa('git', ['merge', currentBranch, '--no-edit'], { cwd: projectRoot, stdio: 'inherit' });
|
|
263
|
+
// Push main
|
|
264
|
+
await execa('git', ['push', 'origin', 'main'], { cwd: projectRoot, stdio: 'inherit' });
|
|
265
|
+
console.log(pc.green('✓ Merged to main and pushed\n'));
|
|
266
|
+
}
|
|
267
|
+
catch (err) {
|
|
268
|
+
console.log(pc.red('Failed to merge. You may need to resolve conflicts manually.\n'));
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
else {
|
|
272
|
+
// Push first (needed for both 'pr' and 'push')
|
|
244
273
|
try {
|
|
245
274
|
const { execa } = await import('execa');
|
|
246
275
|
await execa('git', ['push', '-u', 'origin', currentBranch], { cwd, stdio: 'inherit' });
|
|
247
276
|
console.log(pc.green('✓ Pushed to remote\n'));
|
|
248
|
-
//
|
|
249
|
-
|
|
250
|
-
message: 'Create a pull request?',
|
|
251
|
-
default: true,
|
|
252
|
-
});
|
|
253
|
-
if (shouldCreatePR) {
|
|
277
|
+
// Create PR if requested
|
|
278
|
+
if (mergeAction === 'pr') {
|
|
254
279
|
try {
|
|
255
280
|
await execa('gh', ['pr', 'create', '--fill'], { cwd, stdio: 'inherit' });
|
|
256
281
|
}
|