diff --git a/src/debug.js b/src/debug.js index 89b08b4..c5a83fd 100644 --- a/src/debug.js +++ b/src/debug.js @@ -11,6 +11,6 @@ const Me = extensionUtils.getCurrentExtension(); * @param {string} msg Message to print. */ function message(msg) { - if ('@BUILD_TYPE@' === 'debug') // eslint-disable-line no-constant-condition + if (Me.metadata['build-type'] === 'debug') console.log(`[${Me.metadata.name}] ${msg}`); } diff --git a/src/meson.build b/src/meson.build index 5a0dae4..22a60f5 100644 --- a/src/meson.build +++ b/src/meson.build @@ -7,21 +7,14 @@ configure_file( configuration: { 'DNS': DNS, 'UUID': UUID, - 'VERSION': meson.project_version() - }, - install_dir: INSTALL_DIR -) - -configure_file( - input: 'debug.js', - output: 'debug.js', - configuration: { + 'VERSION': meson.project_version(), 'BUILD_TYPE': get_option('buildtype') }, install_dir: INSTALL_DIR ) main = [ + 'debug.js', 'extension.js', 'prefs.js', 'utils.js', diff --git a/src/metadata.json.in b/src/metadata.json.in index 253a3d5..4780294 100644 --- a/src/metadata.json.in +++ b/src/metadata.json.in @@ -7,5 +7,6 @@ "url": "https://nightthemeswitcher.romainvigier.fr", "session-modes": ["unlock-dialog", "user"], "shell-version": ["43"], - "version": @VERSION@ + "version": @VERSION@, + "build-type": "@BUILD_TYPE@" }