diff --git a/example_config.json b/example_config.json index fae7721..539ee62 100644 --- a/example_config.json +++ b/example_config.json @@ -1,4 +1,5 @@ { + "dev": true, "server": { "listen": "0.0.0.0", "port": 3000 diff --git a/libs/modep.js b/libs/modep.js index 689447b..987ea2f 100644 --- a/libs/modep.js +++ b/libs/modep.js @@ -154,9 +154,10 @@ async function parseCurrentPedalboard(currentPedalboard) { if (currentPedalboard.uri === undefined) { throw new Error('could not determine current pedalboard config file'); } - // FAKE DATA - let file = path.resolve(path.dirname(__dirname) + '/dev/' + currentPedalboard.uri.substring(currentPedalboard.uri.lastIndexOf('/') + 1)); - // let file = path.resolve(currentPedalboard.uri.replace('file://', '')); + let file = path.resolve(currentPedalboard.uri.replace('file://', '')); + if (global.config?.dev) { + file = path.resolve(path.dirname(__dirname) + '/dev/' + currentPedalboard.uri.substring(currentPedalboard.uri.lastIndexOf('/') + 1)); + } const data = await new Promise((resolve, reject) => { fs.readFile(file, (err, data) => { if (err) {