Skip to content

Commit 7c08cb9

Browse files
authored
Merge pull request #127 from chadberchek/fix-registry-path
registry path for scoped package tarball should include scope subdirectory under dash directory
2 parents 45a4f99 + 6960649 commit 7c08cb9

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/registry.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,7 @@ function receivePublishPut (req, res) {
195195
att = att && att.data
196196
var dir = path.resolve(assetdir, data._id)
197197
var jsonFile = path.resolve(dir, 'body.json')
198-
var tgzDir = path.resolve(dir, '-')
199-
var tgzFile = path.resolve(tgzDir, tgzBase)
198+
var tgzFile = path.resolve(dir, '-', tgzBase)
200199

201200
if (!att) {
202201
return _403(req, res, {
@@ -216,7 +215,7 @@ function receivePublishPut (req, res) {
216215
existing = {}
217216
}
218217

219-
mkdirp.sync(tgzDir)
218+
mkdirp.sync(path.dirname(tgzFile))
220219

221220
if (existing && existing.time && existing.time[ver]) {
222221
return _403(req, res, {
@@ -243,7 +242,7 @@ function receivePublishPut (req, res) {
243242
existing.time.modified = now
244243

245244
try {
246-
fs.writeFileSync(tgzFile.replace(/(-\/)@.*?\//, '$1'), att, { encoding: 'base64' })
245+
fs.writeFileSync(tgzFile, att, { encoding: 'base64' })
247246
} catch (er) {
248247
return _500(req, res, er)
249248
}

0 commit comments

Comments
 (0)