From 0c9a0f9788391ceadbd461c2d3b29a73807aa75c Mon Sep 17 00:00:00 2001 From: Restioson Date: Wed, 26 Jul 2023 17:07:17 +0200 Subject: [PATCH] Allow setting RUST_LOG to any value in `just all` --- justfile | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 2598ac2d9..8cfee0f7a 100644 --- a/justfile +++ b/justfile @@ -19,6 +19,14 @@ get_local_ip := if os() == "linux" { "ifconfig | grep -Eo 'inet (addr:)?([0-9]*\\.){3}[0-9]*' | grep -Eo '([0-9]*\\.){3}[0-9]*' | grep -v '127.0.0.1'" } +# RUST_LOG is overriden for FRB codegen invocations it if RUST_LOG isn't info or debug, which means +# a command like `RUST_LOG="warn" just all` would fail +rust_log_for_frb := if env_var_or_default("RUST_LOG", "") =~ "(?i)(trace)|(debug)" { + "debug" +} else { + "info" +} + default: gen precommit: gen lint @@ -44,7 +52,7 @@ gen: set -euxo pipefail cd mobile flutter pub get - flutter_rust_bridge_codegen \ + RUST_LOG={{ rust_log_for_frb }} flutter_rust_bridge_codegen \ --rust-input native/src/api.rs \ --c-output ios/Runner/bridge_generated.h \ --extra-c-output-path macos/Runner/ \