Skip to content

Commit 7eccd86

Browse files
committed
Add scoped package name if package is unscoped, #63
1 parent f9fa455 commit 7eccd86

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,11 @@ function prebuildify (opts, cb) {
7979
loop(opts, function (err) {
8080
if (err) return cb(err)
8181
if (opts.optionalPackages) {
82-
var description = 'Platform specific binary for ' + packageData.name + ' on ' + opts.platform + ' OS with ' + opts.arch + ' architecture'
82+
var packageName = packageData.name
83+
var description = 'Platform specific binary for ' + packageName + ' on ' + opts.platform + ' OS with ' + opts.arch + ' architecture'
8384
fs.writeFileSync(path.join(opts.builds, 'package.json'), JSON.stringify({
84-
name: packageData.name + '-' + opts.platform + '-' + opts.arch,
85+
// append platform, and prefix with scoped name matching package name if unscoped
86+
name: (packageName[0] === '@' ? '' : '@' + packageName + '/') + packageName + '-' + opts.platform + '-' + opts.arch,
8587
version: packageData.version,
8688
os: [opts.platform],
8789
cpu: [opts.arch],

0 commit comments

Comments
 (0)