Skip to content

Commit

Permalink
fix(core): module extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
slvnperron committed May 7, 2019
1 parent cd445b3 commit f2d1c9d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/bp/core/modules/unpacker.ts
Expand Up @@ -48,8 +48,8 @@ export default class ModuleUnpacker {
})

mkdirp.sync(finalDirectory) // Create the `.cache` directory if doesn't exist
// We rename in case the extraction failed and .cache is corrupted
fse.renameSync(temporaryDestination, finalDestination)
// We move in case the extraction failed and .cache is corrupted
fse.moveSync(temporaryDestination, finalDestination)

return finalDestination
}
Expand Down
5 changes: 4 additions & 1 deletion src/bp/index.ts
Expand Up @@ -174,7 +174,10 @@ try {
}
)
.command('extract', 'Extract module archive files (.tgz) in their respective folders', {}, argv => {
require('./extractor').default(argv)
getos.default().then(distro => {
process.distro = distro
require('./extractor').default(argv)
})
})
.option('verbose', {
alias: 'v',
Expand Down

0 comments on commit f2d1c9d

Please sign in to comment.