diff options
author | Zara Zaimeche <zara.zaimeche@codethink.co.uk> | 2015-06-09 17:54:54 +0100 |
---|---|---|
committer | Zara Zaimeche <zara.zaimeche@codethink.co.uk> | 2015-06-10 10:40:14 +0100 |
commit | d47cfbebbd761d23e99c52053545b3e9bb4a38b2 (patch) | |
tree | 65fb3b619968d5fbe2a2ec0c5351a3ff40574604 | |
parent | 40319435eea7cbdd74057a05540c727b597256cd (diff) | |
download | import-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-x | baserockimport/exts/npm.to_lorry | 7 |
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] }; |