Skip to content

Commit f5014f9

Browse files
refactor
1 parent 81097c2 commit f5014f9

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wpe-cli/src/installs/mod.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -127,17 +127,8 @@ pub fn init(sub_n: &ArgMatches, api: API, headless: Option<&bool>) -> Result<()>
127127
match selection {
128128
0 => {
129129
// Handle logic for listing sites.
130-
let install_selection = Select::with_theme(&ColorfulTheme::default())
131-
.with_prompt("Select a site to view...")
132-
.items(&results
133-
.iter()
134-
.map(|install| &install["name"])
135-
.collect::<Vec<&serde_json::Value>>()
136-
)
137-
.interact()?;
138-
139-
let item = &results[install_selection]["id"];
140-
let install = api.get_install_by_id(&item.as_str().unwrap())?;
130+
let (_, install_id) = get_install_data(results, &api)?;
131+
let install = api.get_install_by_id(install_id.as_str())?;
141132

142133
println!("Selection: {}", serde_json::to_string_pretty(&install)?);
143134
},

wpe-cli/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,3 +647,4 @@ impl API {
647647
}
648648
}
649649

650+

0 commit comments

Comments
 (0)