#!/usr/bin/env node const path = require("path"); const fs = require("fs"); const config = { "Dolphin": { "BluetoothPassthrough": { "Enabled": true } } } function format_value(value){ if(typeof value== "boolean"){ return value? "True" : "False"; }else{return value} } for (const [system, sections] of Object.entries(config)) { if(system =="WiimoteNew"){ let content = ""; for (const [section, keys] of Object.entries(sections)) { content += `[${section}]\n`; for (const [key, value] of Object.entries(keys)) { content += `${key} = ${format_value(value)}\n`; } content += "\n"; } fs.writeFileSync(path.resolve(process.env.DOLPHIN_CONFIG_DIR, "WiimoteNew.ini"), content); continue; } for (const [section, keys] of Object.entries(sections)) { for (const [key, value] of Object.entries(keys)) { console.log(`--config=${system}.${section}.${key}=${format_value(value)}`); } } }