patch options.txt

This commit is contained in:
SrGooglo 2024-02-04 21:28:03 +01:00
parent 697049e33d
commit b3a9381504
3 changed files with 13 additions and 1 deletions

3
.gitignore vendored
View File

@ -47,4 +47,5 @@
/**/**/logs /**/**/logs
/**/**/libraries /**/**/libraries
/**/**/saves /**/**/saves
/**/**/versions /**/**/versions
/**/**/options.txt

View File

@ -23,12 +23,16 @@ const defaultConfig = {
assigned_memory: 4096, assigned_memory: 4096,
} }
const fs = require("node:fs")
module.exports = { module.exports = {
...vars, ...vars,
rsb_minimun_version: "0.11.1", rsb_minimun_version: "0.11.1",
import_libs: [ import_libs: [
"mcl", "mcl",
"ipc", "ipc",
"fs",
"path",
], ],
configs: { configs: {
username: { username: {
@ -77,6 +81,13 @@ module.exports = {
}, },
executable: true, executable: true,
check_updates_after_execute: true, check_updates_after_execute: true,
after_install: async (pkg) => {
// patch options.txt from default_options.txt
const defaultOptionsPath = `${pkg.install_path}/default_options.txt`
const finalOptionsPath = `${pkg.install_path}/options.txt`
fs.copyFileSync(defaultOptionsPath, finalOptionsPath)
},
execute: async (pkg) => { execute: async (pkg) => {
const auth = await pkg.libraries.mcl.auth((pkg.storaged_configs?.username ?? defaultConfig.username)) const auth = await pkg.libraries.mcl.auth((pkg.storaged_configs?.username ?? defaultConfig.username))