gitarsenal-cli 1.9.55 → 1.9.56
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 +24 -9
- package/package.json +1 -1
package/.venv_status.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"created":"2025-08-12T17:
|
|
1
|
+
{"created":"2025-08-12T17:17:32.356Z","packages":["modal","gitingest","requests","anthropic"],"uv_version":"uv 0.8.4 (Homebrew 2025-07-30)"}
|
package/bin/gitarsenal.js
CHANGED
|
@@ -376,27 +376,42 @@ function getDefaultVolumeName(repoUrl) {
|
|
|
376
376
|
// Remove trailing slash
|
|
377
377
|
if (url.endsWith('/')) url = url.slice(0, -1);
|
|
378
378
|
|
|
379
|
-
|
|
379
|
+
// Prefer everything after github.com/ (owner/repo)
|
|
380
|
+
if (url.toLowerCase().includes('github.com')) {
|
|
381
|
+
let after = url;
|
|
382
|
+
const markerIndex = after.toLowerCase().indexOf('github.com');
|
|
383
|
+
after = after.slice(markerIndex + 'github.com'.length); // e.g., '/owner/repo.git' or ':owner/repo.git'
|
|
384
|
+
// Strip leading separators
|
|
385
|
+
while (after.startsWith('/') || after.startsWith(':')) after = after.slice(1);
|
|
386
|
+
// Trim query/fragment if present
|
|
387
|
+
const stopIdx = Math.min(
|
|
388
|
+
...[after.indexOf('?'), after.indexOf('#')].map(i => (i === -1 ? after.length : i))
|
|
389
|
+
);
|
|
390
|
+
after = after.slice(0, stopIdx);
|
|
391
|
+
// Remove .git suffix
|
|
392
|
+
if (after.toLowerCase().endsWith('.git')) after = after.slice(0, -4);
|
|
393
|
+
// Sanitize: replace '/' with '_' first, then keep docker-friendly chars
|
|
394
|
+
let vol = after.replace(/[\\/]+/g, '_')
|
|
395
|
+
.replace(/[^a-zA-Z0-9_.-]/g, '_')
|
|
396
|
+
.replace(/_+/g, '_')
|
|
397
|
+
.toLowerCase();
|
|
398
|
+
return vol || 'repo';
|
|
399
|
+
}
|
|
380
400
|
|
|
381
|
-
//
|
|
401
|
+
// Fallback behavior for non-GitHub URLs: use last path segment (repo name)
|
|
402
|
+
let repoName = null;
|
|
382
403
|
try {
|
|
383
404
|
const u = new URL(url);
|
|
384
405
|
const parts = u.pathname.split('/').filter(Boolean);
|
|
385
406
|
repoName = parts[parts.length - 1] || null;
|
|
386
407
|
} catch (_) {
|
|
387
|
-
// Fallback for SSH-like URLs (e.g., git@github.com:user/repo.git)
|
|
388
408
|
const parts = url.split(/[/:]/).filter(Boolean);
|
|
389
409
|
repoName = parts[parts.length - 1] || null;
|
|
390
410
|
}
|
|
391
411
|
|
|
392
412
|
if (!repoName) return 'repo';
|
|
413
|
+
if (repoName.toLowerCase().endsWith('.git')) repoName = repoName.slice(0, -4);
|
|
393
414
|
|
|
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
415
|
repoName = repoName
|
|
401
416
|
.replace(/[^a-zA-Z0-9_.-]/g, '_')
|
|
402
417
|
.replace(/_+/g, '_')
|