diff --git a/bin/do-release.sh b/bin/do-release.sh index 6a29182..271d481 100755 --- a/bin/do-release.sh +++ b/bin/do-release.sh @@ -14,7 +14,7 @@ if [ -z "${TRAVIS_TAG}" ]; then exit 0 fi -./bin/copy-meta.js +./bin/set-meta.js ./bin/set-dependencies.js for package in $(get_packages); do diff --git a/bin/copy-meta.js b/bin/set-meta.js similarity index 82% rename from bin/copy-meta.js rename to bin/set-meta.js index f5d2238..409c4e2 100755 --- a/bin/copy-meta.js +++ b/bin/set-meta.js @@ -26,8 +26,11 @@ for (const pkgName of pkgNames) { const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf8')); for (const field of COMMON_META) { - pkg[field] = topPkg[field]; + pkg[field] = JSON.parse(JSON.stringify(topPkg[field])); } + // https://github.com/npm/rfcs/pull/19 + pkg.repository.directory = path.relative(topPkgDir, pkgDir); + fs.writeFileSync(pkgPath, JSON.stringify(pkg, null, ' ') + '\n', 'utf8'); }