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

1
.gitignore vendored
View File

@ -48,3 +48,4 @@
/**/**/libraries
/**/**/saves
/**/**/versions
/**/**/options.txt

View File

@ -23,12 +23,16 @@ const defaultConfig = {
assigned_memory: 4096,
}
const fs = require("node:fs")
module.exports = {
...vars,
rsb_minimun_version: "0.11.1",
import_libs: [
"mcl",
"ipc",
"fs",
"path",
],
configs: {
username: {
@ -77,6 +81,13 @@ module.exports = {
},
executable: 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) => {
const auth = await pkg.libraries.mcl.auth((pkg.storaged_configs?.username ?? defaultConfig.username))