From eb2e7d58c5b8f6e07bfa7740d15ae5da25f68987 Mon Sep 17 00:00:00 2001 From: Nathan Flurry Date: Tue, 27 Feb 2024 22:13:42 +0000 Subject: [PATCH] fix(bolt): clarify 1password service token warning (#541) ## Changes --- lib/bolt/core/src/tasks/check.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/bolt/core/src/tasks/check.rs b/lib/bolt/core/src/tasks/check.rs index a735ca3055..417b5707cf 100644 --- a/lib/bolt/core/src/tasks/check.rs +++ b/lib/bolt/core/src/tasks/check.rs @@ -195,19 +195,24 @@ pub async fn check_config_sync(ctx: &ProjectContext) { return; } - let (Some(local_op), Some(ns_op)) = ( - ctx.config_local()._1password.as_ref(), - ctx.ns().secrets._1password.as_ref(), - ) else { + // Check if 1Password service token is available + if ctx.ns().secrets._1password.is_some() && ctx.config_local()._1password.is_none() { eprintln!(); rivet_term::status::warn( "Warning", format!( - r#"1Password config is not set up. Configure "ns.1password" and "local.1password" to enable config sync checks, or use `{}` to suppress this message."#, + r#"Cannot validate that config is synchronized without configuring the 1Password service token in Bolt.local.toml. See docs/libraries/bolt/CONFIG_SYNC.md for details or use `{}` to suppress this message."#, style("BOLT_SKIP_CONFIG_SYNC=1").bold() ), ); return; + } + + let (Some(local_op), Some(ns_op)) = ( + ctx.config_local()._1password.as_ref(), + ctx.ns().secrets._1password.as_ref(), + ) else { + return; }; let op_service_account_token = Some(local_op.service_account_token.clone());