Skip to content

Commit

Permalink
Change flag and env var name
Browse files Browse the repository at this point in the history
  • Loading branch information
lucperkins committed Jun 19, 2024
1 parent 1f8a5c4 commit b37716d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/cli/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
6 changes: 3 additions & 3 deletions src/push_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down Expand Up @@ -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('/');

Expand Down

0 comments on commit b37716d

Please sign in to comment.