Skip to content

Commit

Permalink
Add scoped package name if package is unscoped, prebuild/prebuildify#63
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed May 8, 2022
1 parent c9952cb commit 5fe8551
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ load.path = function (dir) {
var nearby = resolve(path.dirname(process.execPath))
if (nearby) return nearby

var platformPackage = packageName + '-' + platform + '-' + arch
// append platform, and prefix with scoped name matching package name if unscoped
var platformPackage = (packageName[0] === '@' ? '' : '@' + packageName + '/') + packageName + '-' + platform + '-' + arch
try {
var prebuildPackage = path.dirname(require('module').createRequire(path.join(dir, 'package.json')).resolve(platformPackage))
return resolveFile(prebuildPackage)
Expand Down

0 comments on commit 5fe8551

Please sign in to comment.