File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -195,8 +195,7 @@ function receivePublishPut (req, res) {
195
195
att = att && att . data
196
196
var dir = path . resolve ( assetdir , data . _id )
197
197
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 )
200
199
201
200
if ( ! att ) {
202
201
return _403 ( req , res , {
@@ -216,7 +215,7 @@ function receivePublishPut (req, res) {
216
215
existing = { }
217
216
}
218
217
219
- mkdirp . sync ( tgzDir )
218
+ mkdirp . sync ( path . dirname ( tgzFile ) )
220
219
221
220
if ( existing && existing . time && existing . time [ ver ] ) {
222
221
return _403 ( req , res , {
@@ -243,7 +242,7 @@ function receivePublishPut (req, res) {
243
242
existing . time . modified = now
244
243
245
244
try {
246
- fs . writeFileSync ( tgzFile . replace ( / ( - \/ ) @ . * ? \/ / , '$1' ) , att , { encoding : 'base64' } )
245
+ fs . writeFileSync ( tgzFile , att , { encoding : 'base64' } )
247
246
} catch ( er ) {
248
247
return _500 ( req , res , er )
249
248
}
You can’t perform that action at this time.
0 commit comments