dependency-change-report 1.4.2 → 1.4.3
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/core/analyzer.mjs +11 -4
- package/package.json +1 -1
package/lib/core/analyzer.mjs
CHANGED
|
@@ -350,30 +350,37 @@ export const analyzeDependencyChanges = async (repoUrl, olderVersion, newerVersi
|
|
|
350
350
|
const currentBranch = await executeCommand('git', ['rev-parse', '--abbrev-ref', 'HEAD'], process.cwd(), time_1min, 'get current branch', false);
|
|
351
351
|
const currentBranchName = currentBranch.trim();
|
|
352
352
|
|
|
353
|
+
console.log(`Current branch: ${currentBranchName}`);
|
|
354
|
+
console.log(`Older version: ${olderVersion}`);
|
|
355
|
+
console.log(`Newer version: ${newerVersion}`);
|
|
356
|
+
|
|
353
357
|
// Check if either version is the currently checked out branch
|
|
354
358
|
const olderIsCurrentBranch = currentBranchName === olderVersion;
|
|
355
359
|
const newerIsCurrentBranch = currentBranchName === newerVersion;
|
|
356
360
|
|
|
357
361
|
if (olderIsCurrentBranch) {
|
|
358
362
|
// Copy current working directory to older version directory
|
|
359
|
-
console.log(`Using current working directory for ${olderVersion}...`);
|
|
363
|
+
console.log(`Using current working directory for ${olderVersion} (currently checked out)...`);
|
|
360
364
|
await executeCommand('cp', ['-r', '.', olderVersionDir], process.cwd(), time_1min, `copy current dir to ${olderVersion}`, isSmallScreen);
|
|
361
365
|
// Remove the .git directory from the copy to avoid conflicts
|
|
362
366
|
await executeCommand('rm', ['-rf', `${olderVersionDir}/.git`], process.cwd(), time_1min, 'cleanup git dir', false);
|
|
363
367
|
|
|
364
|
-
// Create worktree for newer version
|
|
368
|
+
// Create worktree for newer version only
|
|
369
|
+
console.log(`Creating worktree for ${newerVersion}...`);
|
|
365
370
|
await executeCommand('git', ['worktree', 'add', newerVersionDir, newerVersion], process.cwd(), time_1min, `git worktree add ${newerVersion}`, isSmallScreen);
|
|
366
371
|
} else if (newerIsCurrentBranch) {
|
|
367
372
|
// Copy current working directory to newer version directory
|
|
368
|
-
console.log(`Using current working directory for ${newerVersion}...`);
|
|
373
|
+
console.log(`Using current working directory for ${newerVersion} (currently checked out)...`);
|
|
369
374
|
await executeCommand('cp', ['-r', '.', newerVersionDir], process.cwd(), time_1min, `copy current dir to ${newerVersion}`, isSmallScreen);
|
|
370
375
|
// Remove the .git directory from the copy to avoid conflicts
|
|
371
376
|
await executeCommand('rm', ['-rf', `${newerVersionDir}/.git`], process.cwd(), time_1min, 'cleanup git dir', false);
|
|
372
377
|
|
|
373
|
-
// Create worktree for older version
|
|
378
|
+
// Create worktree for older version only
|
|
379
|
+
console.log(`Creating worktree for ${olderVersion}...`);
|
|
374
380
|
await executeCommand('git', ['worktree', 'add', olderVersionDir, olderVersion], process.cwd(), time_1min, `git worktree add ${olderVersion}`, isSmallScreen);
|
|
375
381
|
} else {
|
|
376
382
|
// Neither version is currently checked out, create both worktrees normally
|
|
383
|
+
console.log(`Creating worktrees for both ${olderVersion} and ${newerVersion}...`);
|
|
377
384
|
await executeCommand('git', ['worktree', 'add', olderVersionDir, olderVersion], process.cwd(), time_1min, `git worktree add ${olderVersion}`, isSmallScreen);
|
|
378
385
|
await executeCommand('git', ['worktree', 'add', newerVersionDir, newerVersion], process.cwd(), time_1min, `git worktree add ${newerVersion}`, isSmallScreen);
|
|
379
386
|
}
|