From 8f24eeffb5f83ca0df312e63f270c423867d7157 Mon Sep 17 00:00:00 2001 From: Kittizz <62899732+kittizz@users.noreply.github.com> Date: Wed, 5 Mar 2025 06:12:18 +0700 Subject: [PATCH] fix(cli.ts): multiple files in --inject option to allow injecting multiple .js or .css files --- bin/cli.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/cli.ts b/bin/cli.ts index dd8a369..671221a 100644 --- a/bin/cli.ts +++ b/bin/cli.ts @@ -30,7 +30,12 @@ program .option('--fullscreen', 'Start in full screen', DEFAULT.fullscreen) .option('--hide-title-bar', 'For Mac, hide title bar', DEFAULT.hideTitleBar) .option('--multi-arch', 'For Mac, both Intel and M1', DEFAULT.multiArch) - .option('--inject ', 'Injection of .js or .css files', DEFAULT.inject) + .option( + '--inject <./style.css,./script.js,...>', + 'Injection of .js or .css files', + (val, previous) => (val ? val.split(',').map(item => item.trim()) : DEFAULT.inject), + DEFAULT.inject, + ) .option('--debug', 'Debug build and more output', DEFAULT.debug) .addOption(new Option('--proxy-url ', 'Proxy URL for all network requests').default(DEFAULT_PAKE_OPTIONS.proxyUrl).hideHelp()) .addOption(new Option('--user-agent ', 'Custom user agent').default(DEFAULT.userAgent).hideHelp())