You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.0 KiB
JavaScript
42 lines
1.0 KiB
JavaScript
#!/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)}`);
|
|
}
|
|
}
|
|
}
|