|
1 |
| -use crate::{ |
2 |
| - build::BuildConfig, |
3 |
| - cmd::Commands, |
4 |
| - templates::{Template, TemplateMetadata}, |
5 |
| - Architecture, |
6 |
| -}; |
7 | 1 | use console::Style;
|
8 | 2 | use dialoguer::{theme::ColorfulTheme, Confirm, Input, Select};
|
| 3 | +use goldboot_image::ImageArch; |
9 | 4 | use simple_error::bail;
|
10 | 5 | use std::{error::Error, path::Path};
|
11 | 6 | use strum::IntoEnumIterator;
|
12 | 7 |
|
13 |
| -#[rustfmt::skip] |
14 | 8 | fn print_banner() {
|
15 | 9 | if console::colors_enabled() {
|
16 | 10 | let style = Style::new().yellow();
|
17 | 11 |
|
18 | 12 | println!("{}", "");
|
19 | 13 | for line in fossable::goldboot_word() {
|
20 |
| - println!(" {}", style.apply_to(line)); |
21 |
| - } |
| 14 | + println!(" {}", style.apply_to(line)); |
| 15 | + } |
22 | 16 | println!("{}", "");
|
23 | 17 | }
|
24 | 18 | }
|
25 | 19 |
|
26 |
| -pub fn run(cmd: crate::cmd::Commands) -> Result<(), Box<dyn Error>> { |
| 20 | +pub fn run(cmd: super::Commands) -> Result<(), Box<dyn Error>> { |
27 | 21 | match cmd {
|
28 |
| - Commands::Init { |
| 22 | + super::Commands::Init { |
29 | 23 | name,
|
30 | 24 | template,
|
31 | 25 | mimic_hardware,
|
@@ -91,7 +85,7 @@ pub fn run(cmd: crate::cmd::Commands) -> Result<(), Box<dyn Error>> {
|
91 | 85 |
|
92 | 86 | // Prompt image architecture
|
93 | 87 | {
|
94 |
| - let architectures: Vec<Architecture> = Architecture::iter().collect(); |
| 88 | + let architectures: Vec<ImageArch> = ImageArch::iter().collect(); |
95 | 89 | let arch_index = Select::with_theme(&theme)
|
96 | 90 | .with_prompt("Choose image architecture")
|
97 | 91 | .default(0)
|
@@ -128,7 +122,7 @@ pub fn run(cmd: crate::cmd::Commands) -> Result<(), Box<dyn Error>> {
|
128 | 122 | }
|
129 | 123 |
|
130 | 124 | // Finally write out the config
|
131 |
| - std::fs::write(config_path, serde_yaml::to_string(&config)?)?; |
| 125 | + std::fs::write(config_path, ron::to_string(&config)?)?; |
132 | 126 | Ok(())
|
133 | 127 | }
|
134 | 128 | _ => panic!(),
|
|
0 commit comments