Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
CMCDragonkai committed May 18, 2022
1 parent 3891644 commit da0e1cb
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/pkg.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,17 +132,17 @@ async function main(argv = process.argv) {
const prebuildsFinds = await find(prebuildsPath, /.node$/);
if (buildFinds.length > 0 || prebuildsFinds.length > 0) {
let nativeAddonPath = nodeGypBuild.path(nodePackage);
// Use relative paths
// Must use relative paths
// so that assets are added relative to the project
nativeAddonPath = path.relative(projectRoot, nativeAddonPath);
pkgConfig.assets.push(nativeAddonPath);
}
}
console.error('Configured pkg with:');
console.error(pkgConfig);
const pkgConfigPath = path.join(
os.tmpdir(),
`pkg-bundle-config-${randomString(6)}.json`
);
// The pkg config must be in the same directory as the `package.json`
// otherwise the relative paths won't work
const pkgConfigPath = path.join(projectRoot, 'pkg.json');
await fs.promises.writeFile(pkgConfigPath, JSON.stringify(pkgConfig));
const pkgPlatform = platforms[platform];
const pkgArch = archs[arch];
Expand Down

0 comments on commit da0e1cb

Please sign in to comment.