Commit 87875a4f00604b64bb80b480a5764b44885eef80
Include license field
- in package mention when publishing - when serving package infocel committed on 8/31/2018, 2:31:58 AM
Parent: 52dae1b7fc584ab4f59c8886a1bfe5285db3dfb5
Files changed
index.js | changed |
index.js | |||
---|---|---|---|
@@ -830,8 +830,9 @@ | |||
830 | 830 … | function resolveVersion(version, cb) { | |
831 | 831 … | self.populatePackageJson(obj.versions[version], function (err, pkg) { | |
832 | 832 … | if (err) return cb(err) | |
833 | 833 … | if (pkg) obj.versions[version] = pkg | |
834 … | + if (pkg && pkg.license && !obj.license) obj.license = pkg.license | ||
834 | 835 … | cb() | |
835 | 836 … | }) | |
836 | 837 … | } | |
837 | 838 … | function resolveAll() { | |
@@ -955,8 +956,9 @@ | |||
955 | 956 … | if (pkg.version && pkg.version !== version) | |
956 | 957 … | return self.respondError(400, 'Mismatched package version: ' + [pkg.version, version]) | |
957 | 958 … | linksByVersion[version] = link | |
958 | 959 … | link.version = version | |
960 … | + link.license = pkg.license | ||
959 | 961 … | link.dependencies = pkg.dependencies || {} | |
960 | 962 … | link.bundledDependencies = pkg.bundledDependencies || pkg.bundleDependencies | |
961 | 963 … | } | |
962 | 964 … | ||
@@ -980,8 +982,9 @@ | |||
980 | 982 … | name: 'npm:' + name + ':' + link.version + (link.tag ? ':' + link.tag : ''), | |
981 | 983 … | link: link.link, | |
982 | 984 … | size: link.size, | |
983 | 985 … | shasum: link.shasum, | |
986 … | + license: link.license, | ||
984 | 987 … | dependencies: link.dependencies, | |
985 | 988 … | bundledDependencies: link.bundledDependencies, | |
986 | 989 … | }) | |
987 | 990 … | } | |
@@ -1032,8 +1035,9 @@ | |||
1032 | 1035 … | pkg.dist.shasum = pkg._shasum | |
1033 | 1036 … | pkg.author = pkg.author || obj.author | |
1034 | 1037 … | pkg.version = pkg.version || obj.version | |
1035 | 1038 … | pkg.name = pkg.name || obj.name | |
1039 … | + pkg.license = pkg.license || obj.license | ||
1036 | 1040 … | cb(null, pkg) | |
1037 | 1041 … | }) | |
1038 | 1042 … | } | |
1039 | 1043 … | }) |
Built with git-ssb-web