Skip to content

Commit 5bb1c1e

Browse files
committed
address gemini-code-assist feedback
Signed-off-by: Terence Lee <hone02@gmail.com>
1 parent fb71e1e commit 5bb1c1e

File tree

1 file changed

+5
-1
lines changed
  • crates/system-reinstall-bootc/src

1 file changed

+5
-1
lines changed

crates/system-reinstall-bootc/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,12 @@ impl ReinstallOptsArgs {
5151
os_release::get_bootc_image_from_file(ETC_OS_RELEASE)
5252
.ok()
5353
.flatten()
54+
.filter(|s| !s.is_empty())
5455
.or_else(|| {
5556
os_release::get_bootc_image_from_file(USR_LIB_OS_RELEASE)
5657
.ok()
5758
.flatten()
59+
.filter(|s| !s.is_empty())
5860
})
5961
.ok_or_else(|| {
6062
anyhow::anyhow!(
@@ -72,6 +74,8 @@ impl ReinstallOptsArgs {
7274

7375
#[context("run")]
7476
fn run() -> Result<()> {
77+
let args = ReinstallOptsArgs::parse();
78+
7579
// We historically supported an environment variable providing a config to override the image, so
7680
// keep supporting that. I'm considering deprecating that though.
7781
let opts = if let Some(config) = config::ReinstallConfig::load().context("loading config")? {
@@ -81,7 +85,7 @@ fn run() -> Result<()> {
8185
}
8286
} else {
8387
// Otherwise an image is specified via the CLI or fallback to the os-release
84-
ReinstallOptsArgs::parse().build()?
88+
args.build()?
8589
};
8690

8791
bootc_utils::initialize_tracing();

0 commit comments

Comments
 (0)