remove file extention from device names

This commit is contained in:
bakedpotatolord 2025-05-12 12:46:19 -06:00
commit 4ff44e84f5

5
app.js
View file

@ -668,7 +668,10 @@ function generateDevices() {
fs.readdirSync(root).forEach(type => {
let map = devs[type] = devs[type] || {};
fs.readdirSync(PATH.join(root,type)).forEach(device => {
map[device] = JSON.parse(fs.readFileSync(PATH.join(root,type,device)));
let deviceName = device.endsWith('.json')
? device.substring(0,device.length-5)
: device;
map[deviceName] = JSON.parse(fs.readFileSync(PATH.join(root,type,device)));
});
});
synth.devices = `self.devices = ${JSON.stringify(devs)};`;