Skip to content

Commit

Permalink
Add scoped package name if package is unscoped, #63
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed May 7, 2022
1 parent f9fa455 commit 21db9b0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ function prebuildify (opts, cb) {
loop(opts, function (err) {
if (err) return cb(err)
if (opts.optionalPackages) {
var description = 'Platform specific binary for ' + packageData.name + ' on ' + opts.platform + ' OS with ' + opts.arch + ' architecture'
var packageName = packageData.name
var description = 'Platform specific binary for ' + packageName + ' on ' + opts.platform + ' OS with ' + opts.arch + ' architecture'
fs.writeFileSync(path.join(opts.builds, 'package.json'), JSON.stringify({
name: packageData.name + '-' + opts.platform + '-' + opts.arch,
// append platform, and prefix with scoped name matching package name if unscoped
name: (packageName[0] == '@' ? '' : '@' + packageName + '/') + packageName + '-' + opts.platform + '-' + opts.arch,
version: packageData.version,
os: [opts.platform],
cpu: [opts.arch],
Expand Down

0 comments on commit 21db9b0

Please sign in to comment.