forked from liamcottle/atlas-for-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update_assets.js
26 lines (22 loc) · 935 Bytes
/
update_assets.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/**
* This script is used to update the asset files used in Atlas from the latest version of Rust.
* Existing item images will not be deleted. Images are only added or updated.
*
* 1 - Update Rust on your PC to the latest version.
* 2 - Run: node update_assets.js "<drive>:\SteamLibrary\steamapps\common\Rust"
* 3 - Commit and push the changes to GitHub.
*/
const args = process.argv.slice(2);
const RustAssetManager = require('./tools/RustAssetManager');
// make sure rust path is provided
const rustPath = args[0];
if(rustPath == null || typeof(rustPath) !== "string"){
console.error("Please provide the path to your Rust installation when running this script.");
return;
}
// setup rust asset manager
const rustAssetManager = new RustAssetManager(rustPath);
// update items.json
rustAssetManager.writeItemsMetadata('./src/items.json');
// copy item images
rustAssetManager.copyItemImages('./public/images/items/');