Cleanup of yarn-project.nix

This commit is contained in:
Stéphan Kochen
2020-08-25 18:20:16 +02:00
parent 7682962581
commit 708e36eaf4
4 changed files with 49 additions and 69 deletions
+7 -1
View File
@@ -71,11 +71,17 @@ const generate = async (project: Project, cache: Cache, report: Report) => {
const filename = ppath.basename(cachePath);
if (!cacheFiles.has(filename)) continue;
let name = structUtils.slugifyIdent(pkg).replace(/^@/, "_at_");
if (pkg.version) {
name += `-${pkg.version}`;
}
const sha512 = checksum.split(`/`).pop();
cacheEntries.push([
`name = ${JSON.stringify(name)};`,
`filename = ${JSON.stringify(filename)};`,
`sha512 = ${JSON.stringify(sha512)};`,
`locator-hash = ${JSON.stringify(pkg.locatorHash)};`,
`locatorHash = ${JSON.stringify(pkg.locatorHash)};`,
]);
}