mirror of
https://github.com/mmvanheusden/SteamDepotDownloaderGUI.git
synced 2026-02-04 05:31:19 +01:00
refactor: refactor download utility
This commit is contained in:
6
utils.js
6
utils.js
@@ -69,13 +69,13 @@ function download(url) {
|
||||
const fs = require("fs")
|
||||
const path = require("path")
|
||||
const file = fs.createWriteStream(platformpath() + path.sep + url.split("/").pop())
|
||||
https.get(url, function (response) {
|
||||
https.get(url, (response) => {
|
||||
response.pipe(file)
|
||||
file.on("finish", function () {
|
||||
file.on("finish", () => {
|
||||
file.close()
|
||||
resolve()
|
||||
})
|
||||
file.on("error", function (error) {
|
||||
file.on("error", (error) => {
|
||||
console.error(error)
|
||||
reject(error)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user