agentwheel 0.20.4 → 0.20.5
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
CHANGED
|
@@ -3814,6 +3814,7 @@ async function matchingGitAuthProfile(url) {
|
|
|
3814
3814
|
const config = await readGitAuthConfig();
|
|
3815
3815
|
if (!config) return void 0;
|
|
3816
3816
|
const repository = repositoryKey(url);
|
|
3817
|
+
if (!repository) return void 0;
|
|
3817
3818
|
return Object.values(config.profiles).find(
|
|
3818
3819
|
(profile) => profile.repositories.some((pattern) => matchesRepository(pattern, repository))
|
|
3819
3820
|
);
|
|
@@ -3847,8 +3848,13 @@ function parseGitAuthConfig(value, path) {
|
|
|
3847
3848
|
return { profiles };
|
|
3848
3849
|
}
|
|
3849
3850
|
function repositoryKey(url) {
|
|
3850
|
-
|
|
3851
|
-
|
|
3851
|
+
try {
|
|
3852
|
+
const parsed = new URL(url);
|
|
3853
|
+
if (!parsed.host) return void 0;
|
|
3854
|
+
return `${parsed.host}/${parsed.pathname.replace(/^\//, "").replace(/\.git$/, "")}`.toLowerCase();
|
|
3855
|
+
} catch {
|
|
3856
|
+
return void 0;
|
|
3857
|
+
}
|
|
3852
3858
|
}
|
|
3853
3859
|
function matchesRepository(pattern, repository) {
|
|
3854
3860
|
const escaped = pattern.toLowerCase().replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
|
package/openpack.json
CHANGED
package/package.json
CHANGED