ppackage 2.3.6 → 2.3.7
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/index.js +1 -3
- package/lib/util.js +4 -0
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -198,9 +198,7 @@ class ppackage {
|
|
|
198
198
|
repository_url = body.repository.url;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
-
|
|
202
|
-
repository_url = git_to_https(repository_url);
|
|
203
|
-
|
|
201
|
+
repository_url = git_to_https(repository_url);
|
|
204
202
|
return {repository_url};
|
|
205
203
|
}
|
|
206
204
|
|
package/lib/util.js
CHANGED
|
@@ -33,6 +33,10 @@ const git_to_https = function(repository_url) {
|
|
|
33
33
|
if(GIT_PREFIX.test(repository_url))
|
|
34
34
|
repository_url = repository_url.replace(GIT_PREFIX, "");
|
|
35
35
|
|
|
36
|
+
|
|
37
|
+
if(process.env.SSH_AUTH_SOCK)
|
|
38
|
+
return repository_url;
|
|
39
|
+
|
|
36
40
|
const SSH_MASK = new RegExp("^git@([^:]+):(.*)");
|
|
37
41
|
if(SSH_MASK.test(repository_url))
|
|
38
42
|
return repository_url.replace(SSH_MASK, "https://$1/$2");
|