Skip to content

Commit

Permalink
feat: add ciel update-os argument --force-use-apt
Browse files Browse the repository at this point in the history
  • Loading branch information
eatradish committed Aug 7, 2024
1 parent fe57dea commit 9ed581a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ pub fn build_cli() -> Command {
.arg(Arg::new("arch").short('a').long("arch").help("Specify the target architecture for fetching OS tarball"))
.about("Unpack OS tarball or fetch the latest BuildKit from the repository"),
)
.subcommand(Command::new("update-os").about("Update the OS in the container"))
.subcommand(
Command::new("update-os")
.arg(Arg::new("force_use_apt").long("force-use-apt").help("Use apt to update-os"))
.about("Update the OS in the container")
)
.subcommand(
Command::new("load-tree")
.arg(Arg::new("url").default_value(GIT_TREE_URL).help("URL to the git repository"))
Expand Down
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,12 @@ fn main() -> Result<()> {
)
});
}
("update-os", _) => {
print_error!({ actions::update_os(read_config().is_ok_and(|x| x.force_use_apt)) });
("update-os", args) => {
print_error!({
actions::update_os(
args.get_flag("force_use_apt") || read_config().is_ok_and(|x| x.force_use_apt),
)
});
}
("config", args) => {
if args.get_flag("g") {
Expand Down

0 comments on commit 9ed581a

Please sign in to comment.