File tree Expand file tree Collapse file tree 1 file changed +9
-23
lines changed Expand file tree Collapse file tree 1 file changed +9
-23
lines changed Original file line number Diff line number Diff line change 1- use simplelog :: error ;
1+ use anyhow :: Result ;
22use std:: fs:: File ;
33use std:: io:: Write ;
44use std:: process:: exit;
5+ use tracing:: error;
56
67use crate :: init:: { self as init, templatize_init} ;
78use crate :: { access_handlers:: frontend, commands:: deploy} ;
89
9- pub fn run ( _interactive : & bool , _blank : & bool ) {
10+ pub fn run ( _interactive : & bool , _blank : & bool ) -> Result < ( ) > {
1011 let options: init:: InitVars ;
1112
1213 if * _interactive {
13- options = match init:: interactive_init ( ) {
14- Ok ( t) => t,
15- Err ( e) => {
16- error ! ( "Error in init: {e}" ) ;
17- exit ( 1 ) ;
18- }
19- } ;
14+ options = init:: interactive_init ( ) ?;
2015 } else if * _blank {
2116 options = init:: blank_init ( ) ;
2217 } else {
2318 options = init:: example_init ( ) ;
2419 }
2520
2621 let configuration = templatize_init ( options) ;
27- let mut f = match File :: create ( "rcds.yaml" ) {
28- Ok ( t) => t,
29- Err ( e) => {
30- error ! ( "Error in init: {e}" ) ;
31- exit ( 1 ) ;
32- }
33- } ;
34- match f. write_all ( configuration. as_bytes ( ) ) {
35- Ok ( _) => ( ) ,
36- Err ( e) => {
37- error ! ( "Error in init: {e}" ) ;
38- exit ( 1 ) ;
39- }
40- }
22+
23+ let mut f = File :: create ( "rcds.yaml" ) ?;
24+ f. write_all ( configuration. as_bytes ( ) ) ?;
4125
4226 // Note about external-dns
4327 println ! ( "Note: external-dns configuration settings will need to be provided in rcds.yaml after file creation, under the `profiles.name.dns` key." ) ;
4428 println ! ( "Reference: https://github.com/bitnami/charts/tree/main/bitnami/external-dns" ) ;
29+
30+ Ok ( ( ) )
4531}
You can’t perform that action at this time.
0 commit comments