From 188d2145b3460173558147ebefa288eb2a7d56f1 Mon Sep 17 00:00:00 2001 From: noons Date: Wed, 18 Oct 2023 03:30:46 -0300 Subject: [PATCH] Allow passing arguments to zypak-helper This support the new changes on zypak-helper https://github.com/refi64/zypak/blob/ded79a2f8a509adc21834b95a9892073d4a91fdc/zypak-wrapper.sh#L12 --- editor-wrapper.sh | 2 +- meson.build | 6 ++++++ meson_options.txt | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/editor-wrapper.sh b/editor-wrapper.sh index 9bf3e04..d11b7fe 100755 --- a/editor-wrapper.sh +++ b/editor-wrapper.sh @@ -18,7 +18,7 @@ function exec_editor() { export ZYPAK_BIN="@ZYPAK_BINDIR@" export ZYPAK_LIB="@ZYPAK_LIBDIR@" export CHROME_WRAPPER="@WRAPPER_PATH@" - exec "@ZYPAK_BINDIR@/zypak-helper" host "@EDITOR_BINARY@" "$@" + exec "@ZYPAK_BINDIR@/zypak-helper" @ZYPAK_ARGS@ "@EDITOR_BINARY@" "$@" else exec "@EDITOR_BINARY@" "$@" fi diff --git a/meson.build b/meson.build index 85bdf24..94e0ece 100644 --- a/meson.build +++ b/meson.build @@ -36,6 +36,11 @@ foreach arg : get_option('editor_args') editor_args += '"@0@"'.format(arg) endforeach +zypak_args = [] +foreach arg : get_option('zypak_args') + zypak_args += '"@0@"'.format(arg) +endforeach + export_envs = [] foreach env : get_option('envs') var = env.split('=') @@ -62,6 +67,7 @@ wrapper_data = configuration_data({ 'WRAPPER_PATH': wrapper_path, 'EDITOR_BINARY': editor_path, 'EDITOR_ARGS': ' '.join(editor_args), + 'ZYPAK_ARGS': ' '.join(zypak_args), 'EXPORT_ENVS': ' && '.join(export_envs), 'EXPORT_ENVS_INNER': ' && '.join(export_envs_inner), 'EDITOR_TITLE': get_option('editor_title'), diff --git a/meson_options.txt b/meson_options.txt index 414206f..f31c9fe 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -8,5 +8,6 @@ option('first_run_template', type: 'string', value: 'first_run.txt') option('sdk_update_template', type: 'string', value: 'sdk_update.txt') option('flagfile_prefix', type: 'string', value: 'flatpak-vscode') option('zypak', type: 'feature', value: 'disabled') +option('zypak_args', type: 'array', value: ['host']) option('envs', type: 'array', value: []) option('envs_inner', type: 'array', value: [])