summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZara Zaimeche <zara.zaimeche@codethink.co.uk>2015-06-09 17:54:54 +0100
committerZara Zaimeche <zara.zaimeche@codethink.co.uk>2015-06-10 10:40:14 +0100
commitd47cfbebbd761d23e99c52053545b3e9bb4a38b2 (patch)
tree65fb3b619968d5fbe2a2ec0c5351a3ff40574604
parent40319435eea7cbdd74057a05540c727b597256cd (diff)
downloadimport-d47cfbebbd761d23e99c52053545b3e9bb4a38b2.tar.gz
Clean up data so url is valid
Some people now put urls in the registry with '+git' at the start. The tool doesn't recognise this, but these urls still end in '.git', so this change just checks for such urls and cuts out the '+git'. The tool finds the repos once more. Panic over. Change-Id: I4e807797ed914fa1dbe96cc7e05263228785c86d
-rwxr-xr-xbaserockimport/exts/npm.to_lorry7
1 files changed, 6 insertions, 1 deletions
diff --git a/baserockimport/exts/npm.to_lorry b/baserockimport/exts/npm.to_lorry
index ab66f44..65e8e48 100755
--- a/baserockimport/exts/npm.to_lorry
+++ b/baserockimport/exts/npm.to_lorry
@@ -46,9 +46,14 @@ npm.load(function(er, npm) {
repoInfo = package.repository;
pathWithPkgName = "npm/" + packageName;
+ if (/^git\+/.test(repoInfo["url"]))
+ url = repoInfo["url"].replace(/^git\+/, "");
+ else
+ url = repoInfo["url"];
+
lorry = {};
lorry[pathWithPkgName] = {
- "url": repoInfo["url"],
+ "url": url,
"type": repoInfo["type"],
"x-products-npm": [packageName]
};