Skip to content

Commit

Permalink
update code per comments
Browse files Browse the repository at this point in the history
  • Loading branch information
bentongxyz committed Nov 8, 2022
1 parent aceca05 commit b2bc65b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,7 @@ impl<'a> Builder<'a> {
Subcommand::Install { ref paths } => (Kind::Install, &paths[..]),
Subcommand::Run { ref paths } => (Kind::Run, &paths[..]),
Subcommand::Format { .. } => (Kind::Format, &[][..]),
Subcommand::Setup { ref paths } => (Kind::Setup, &paths[..]),
Subcommand::Setup { ref path } => (Kind::Setup, std::slice::from_ref(path)),
Subcommand::Clean { .. } => {
panic!()
}
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ pub enum Subcommand {
paths: Vec<PathBuf>,
},
Setup {
paths: Vec<PathBuf>,
path: PathBuf,
},
}

Expand Down Expand Up @@ -633,7 +633,7 @@ Arguments:
} else {
t!(crate::setup::interactive_path())
};
Subcommand::Setup { paths: vec![PathBuf::from(profile.as_str())] }
Subcommand::Setup { path: PathBuf::from(profile.as_str()) }
}
};

Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/setup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ impl Step for Profile {
}

fn make_run(run: RunConfig<'_>) {
// for Profile, `run.paths` will have 1 and only 1 element
// this is because we only accept at most 1 path from user input.
// If user calls `x.py setup` without arguments, the interacctive TUI
// will guide user to provide one.
let profile: Profile = run
.paths
.first()
Expand Down

0 comments on commit b2bc65b

Please sign in to comment.