From b37716de4e081b858d566959910b3543e068bf67 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 19 Jun 2024 11:44:00 -0700 Subject: [PATCH] Change flag and env var name --- src/cli/mod.rs | 8 ++++++-- src/push_context.rs | 6 +++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index 8b41ac7..b20ec8c 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -112,8 +112,12 @@ pub(crate) struct FlakeHubPushCli { // Gitlab has a concept of subgroups, which enables repo names like https://gitlab.com/a/b/c/d/e/f/g. By default, // flakehub-push would parse that to flake name `a/b-c-d-e-f-g`. This flag/environment variable provides a // mechanism to disable this behavior. - #[clap(long, env = "FLAKEHUB_PUSH_DISABLE_SUBGROUPS", default_value_t = false)] - pub(crate) disable_subgroups: bool, + #[clap( + long, + env = "FLAKEHUB_PUSH_DISABLE_RENAME_SUBGROUPS", + default_value_t = true + )] + pub(crate) disable_rename_subgroups: bool, } #[derive(Clone, Debug)] diff --git a/src/push_context.rs b/src/push_context.rs index 53ae95c..fe27f58 100644 --- a/src/push_context.rs +++ b/src/push_context.rs @@ -105,7 +105,7 @@ impl PushContext { }; let (project_owner, project_name) = - get_project_owner_and_name(repository, exec_env.clone(), cli.disable_subgroups)?; + get_project_owner_and_name(repository, exec_env.clone(), cli.disable_rename_subgroups)?; let maybe_git_root = match &cli.git_root.0 { Some(gr) => Ok(gr.to_owned()), @@ -389,10 +389,10 @@ impl PushContext { fn get_project_owner_and_name( repository: &str, exec_env: ExecutionEnvironment, - subgroups_explicitly_disabled: bool, + renaming_subgroups_explicitly_disabled: bool, ) -> Result<(String, String)> { let subgroups_enabled = - !subgroups_explicitly_disabled && matches!(exec_env, ExecutionEnvironment::GitLab); + !renaming_subgroups_explicitly_disabled && matches!(exec_env, ExecutionEnvironment::GitLab); let mut repository_split = repository.split('/');