Skip to content

Commit

Permalink
fix: touch update before tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx committed Jun 12, 2018
1 parent 8921736 commit df4d75f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/commands/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export default class UpdateCommand extends Command {
await extraction

await this.createBin(version)
await this.touch()
await this.reexec()
}

Expand Down Expand Up @@ -163,6 +164,18 @@ export default class UpdateCommand extends Command {
}
}

private async touch() {
// touch the client so it won't be tidied up right away
try {
const p = path.join(this.clientRoot, this.config.version)
this.debug('touching client at', p)
if (!await fs.pathExists(p)) return
await fs.utimes(p, new Date(), new Date())
} catch (err) {
this.warn(err)
}
}

private async reexec() {
cli.action.stop()
return new Promise((_, reject) => {
Expand Down

0 comments on commit df4d75f

Please sign in to comment.