gitarsenal-cli 1.9.53 → 1.9.55
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/.venv_status.json +1 -1
- package/bin/gitarsenal.js +44 -3
- package/package.json +1 -1
package/.venv_status.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"created":"2025-08-
|
|
1
|
+
{"created":"2025-08-12T17:14:40.503Z","packages":["modal","gitingest","requests","anthropic"],"uv_version":"uv 0.8.4 (Homebrew 2025-07-30)"}
|
package/bin/gitarsenal.js
CHANGED
|
@@ -41,7 +41,7 @@ function activateVirtualEnvironment() {
|
|
|
41
41
|
if (fs.existsSync(statusFile)) {
|
|
42
42
|
try {
|
|
43
43
|
const status = JSON.parse(fs.readFileSync(statusFile, 'utf8'));
|
|
44
|
-
console.log(chalk.gray(`📦 Packages: ${status.packages.join(', ')}`));
|
|
44
|
+
// console.log(chalk.gray(`📦 Packages: ${status.packages.join(', ')}`));
|
|
45
45
|
} catch (error) {
|
|
46
46
|
console.log(chalk.gray('✅ Virtual environment found'));
|
|
47
47
|
}
|
|
@@ -367,6 +367,47 @@ async function fetchFullSetupAndRecs(repoUrl) {
|
|
|
367
367
|
return null;
|
|
368
368
|
}
|
|
369
369
|
|
|
370
|
+
// Helper to derive a default volume name from the repository URL
|
|
371
|
+
function getDefaultVolumeName(repoUrl) {
|
|
372
|
+
try {
|
|
373
|
+
if (!repoUrl || typeof repoUrl !== 'string') return 'repo';
|
|
374
|
+
let url = repoUrl.trim();
|
|
375
|
+
|
|
376
|
+
// Remove trailing slash
|
|
377
|
+
if (url.endsWith('/')) url = url.slice(0, -1);
|
|
378
|
+
|
|
379
|
+
let repoName = null;
|
|
380
|
+
|
|
381
|
+
// Try URL parsing for http/https
|
|
382
|
+
try {
|
|
383
|
+
const u = new URL(url);
|
|
384
|
+
const parts = u.pathname.split('/').filter(Boolean);
|
|
385
|
+
repoName = parts[parts.length - 1] || null;
|
|
386
|
+
} catch (_) {
|
|
387
|
+
// Fallback for SSH-like URLs (e.g., git@github.com:user/repo.git)
|
|
388
|
+
const parts = url.split(/[/:]/).filter(Boolean);
|
|
389
|
+
repoName = parts[parts.length - 1] || null;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
if (!repoName) return 'repo';
|
|
393
|
+
|
|
394
|
+
// Strip .git suffix if present
|
|
395
|
+
if (repoName.toLowerCase().endsWith('.git')) {
|
|
396
|
+
repoName = repoName.slice(0, -4);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
// Sanitize to a Docker-friendly volume name
|
|
400
|
+
repoName = repoName
|
|
401
|
+
.replace(/[^a-zA-Z0-9_.-]/g, '_')
|
|
402
|
+
.replace(/_+/g, '_')
|
|
403
|
+
.toLowerCase();
|
|
404
|
+
|
|
405
|
+
return repoName || 'repo';
|
|
406
|
+
} catch (_) {
|
|
407
|
+
return 'repo';
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
370
411
|
// Function to send user data to web application
|
|
371
412
|
async function sendUserData(userId, userName, userEmail) {
|
|
372
413
|
try {
|
|
@@ -885,7 +926,7 @@ async function runContainerCommand(options) {
|
|
|
885
926
|
type: 'input',
|
|
886
927
|
name: 'volumeName',
|
|
887
928
|
message: 'Enter volume name:',
|
|
888
|
-
default:
|
|
929
|
+
default: getDefaultVolumeName(repoUrl),
|
|
889
930
|
when: (answers) => answers.useVolume
|
|
890
931
|
}
|
|
891
932
|
]);
|
|
@@ -895,7 +936,7 @@ async function runContainerCommand(options) {
|
|
|
895
936
|
}
|
|
896
937
|
} else if (!volumeName && skipConfirmation) {
|
|
897
938
|
// If --yes flag is used and no volume specified, use default
|
|
898
|
-
volumeName =
|
|
939
|
+
volumeName = getDefaultVolumeName(repoUrl);
|
|
899
940
|
}
|
|
900
941
|
|
|
901
942
|
// Ask about setup command detection if not specified via CLI
|