Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Commit

Permalink
fs async methods are callbacks not promises.
Browse files Browse the repository at this point in the history
  • Loading branch information
damieng committed Sep 25, 2017
1 parent daff9ba commit c3d4be3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ class JavaLanguageClient extends AutoLanguageClient {
const decompress = require('decompress')
this.logger.log(`Downloading ${serverDownloadUrl} to ${localFileName}`);
return this.fileExists(serverHome)
.then(doesExist => { if (!doesExist) return fs.mkdir(serverHome) })
.then(doesExist => { if (!doesExist) fs.mkdirSync(serverHome) })
.then(() => DownloadFile(serverDownloadUrl, localFileName, (bytesDone, percent) => this.updateStatusBar(`downloading ${percent}%`), serverDownloadSize))
.then(() => this.updateStatusBar('unpacking'))
.then(() => decompress(localFileName, serverHome))
.then(() => this.fileExists(path.join(serverHome, serverLauncher)))
.then(doesExist => { if (!doesExist) throw Error(`Failed to install the ${this.getServerName()} language server`) })
.then(() => this.updateStatusBar('installed'))
.then(() => fs.unlink(localFileName))
.then(() => fs.unlinkSync(localFileName))
}

preInitialization(connection) {
Expand Down

0 comments on commit c3d4be3

Please sign in to comment.