From dc0640b90606d8692d1eed6eb6c810f028ddc2ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6ran=20Sander?= Date: Mon, 22 Apr 2024 18:04:27 +0000 Subject: [PATCH] feat(script-get): Add option for (not) loading data when app is opened Implements #459 --- src/ctrl-q.js | 1 + src/lib/cmd/getscript.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ctrl-q.js b/src/ctrl-q.js index b98911a..c86fdfa 100644 --- a/src/ctrl-q.js +++ b/src/ctrl-q.js @@ -509,6 +509,7 @@ program.configureHelp({ .option('--port ', 'Qlik Sense server engine port (usually 4747 for cert auth, 443 for jwt auth)', '4747') .option('--schema-version ', 'Qlik Sense engine schema version', '12.612.0') .requiredOption('--app-id ', 'Qlik Sense app ID') + .addOption(new Option('--open-without-data ', 'open app without data').choices(['true', 'false']).default('true')) .requiredOption('--virtual-proxy ', 'Qlik Sense virtual proxy prefix', '') .requiredOption( '--secure ', diff --git a/src/lib/cmd/getscript.js b/src/lib/cmd/getscript.js index c778a11..aaf9be6 100644 --- a/src/lib/cmd/getscript.js +++ b/src/lib/cmd/getscript.js @@ -53,7 +53,12 @@ const getScript = async (options) => { process.exit(1); } - const app = await global.openDoc(options.appId, '', '', '', false); + // Get open-app-without-data option from command line + // Convert string to boolean + const openWithoutData = options.openWithoutData === 'true'; + logger.verbose(`Open app without data: ${openWithoutData}`); + + const app = await global.openDoc(options.appId, '', '', '', openWithoutData); logger.verbose(`Opened app ${options.appId}.`); // Get app script