From b3a9381504104f4fe66428bfd527fb2c4e60110f Mon Sep 17 00:00:00 2001 From: SrGooglo Date: Sun, 4 Feb 2024 21:28:03 +0100 Subject: [PATCH] patch options.txt --- .gitignore | 3 ++- options.txt => default_options.txt | 0 manifest | 11 +++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-) rename options.txt => default_options.txt (100%) diff --git a/.gitignore b/.gitignore index 8e53176..0a9cc8d 100644 --- a/.gitignore +++ b/.gitignore @@ -47,4 +47,5 @@ /**/**/logs /**/**/libraries /**/**/saves -/**/**/versions \ No newline at end of file +/**/**/versions +/**/**/options.txt \ No newline at end of file diff --git a/options.txt b/default_options.txt similarity index 100% rename from options.txt rename to default_options.txt diff --git a/manifest b/manifest index be70c37..f126ab7 100644 --- a/manifest +++ b/manifest @@ -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))