Skip to content

Commit b2bc65b

Browse files
committed
update code per comments
1 parent aceca05 commit b2bc65b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/bootstrap/builder.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -825,7 +825,7 @@ impl<'a> Builder<'a> {
825825
Subcommand::Install { ref paths } => (Kind::Install, &paths[..]),
826826
Subcommand::Run { ref paths } => (Kind::Run, &paths[..]),
827827
Subcommand::Format { .. } => (Kind::Format, &[][..]),
828-
Subcommand::Setup { ref paths } => (Kind::Setup, &paths[..]),
828+
Subcommand::Setup { ref path } => (Kind::Setup, std::slice::from_ref(path)),
829829
Subcommand::Clean { .. } => {
830830
panic!()
831831
}

src/bootstrap/flags.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ pub enum Subcommand {
142142
paths: Vec<PathBuf>,
143143
},
144144
Setup {
145-
paths: Vec<PathBuf>,
145+
path: PathBuf,
146146
},
147147
}
148148

@@ -633,7 +633,7 @@ Arguments:
633633
} else {
634634
t!(crate::setup::interactive_path())
635635
};
636-
Subcommand::Setup { paths: vec![PathBuf::from(profile.as_str())] }
636+
Subcommand::Setup { path: PathBuf::from(profile.as_str()) }
637637
}
638638
};
639639

src/bootstrap/setup.rs

+4
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ impl Step for Profile {
9898
}
9999

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

0 commit comments

Comments
 (0)