@@ -30,7 +30,7 @@ import (
3030)
3131
3232func newFlashCmd () * cobra.Command {
33- var forceYes bool
33+ var forceYes , preserveUser bool
3434 appCmd := & cobra.Command {
3535 Use : "flash" ,
3636 Short : "Flash a Debian image on the board" ,
@@ -66,11 +66,11 @@ NOTE: On Windows, required drivers are automatically installed with elevated pri
6666 Args : cobra .ExactArgs (1 ),
6767 Run : func (cmd * cobra.Command , args []string ) {
6868 checkDriversInstalled ()
69- runFlashCommand (cmd .Context (), args , forceYes )
69+ runFlashCommand (cmd .Context (), args , forceYes , preserveUser )
7070 },
7171 }
7272 appCmd .Flags ().BoolVarP (& forceYes , "yes" , "y" , false , "Automatically confirm all prompts" )
73- // TODO: add --clean-install flag or something similar to distinguish between keeping and purging the /home directory
73+ appCmd . Flags (). BoolVar ( & preserveUser , "preserve-user" , false , "Preserve user partition" )
7474
7575 return appCmd
7676}
@@ -86,13 +86,13 @@ func checkDriversInstalled() {
8686 }
8787}
8888
89- func runFlashCommand (ctx context.Context , args []string , forceYes bool ) {
89+ func runFlashCommand (ctx context.Context , args []string , forceYes bool , preserveUser bool ) {
9090 imagePath , err := paths .New (args [0 ]).Abs ()
9191 if err != nil {
9292 feedback .Fatal (i18n .Tr ("could not find image absolute path: %v" , err ), feedback .ErrBadArgument )
9393 }
9494
95- err = updater .Flash (ctx , imagePath , args [0 ], forceYes )
95+ err = updater .Flash (ctx , imagePath , args [0 ], forceYes , preserveUser )
9696 if err != nil {
9797 feedback .Fatal (i18n .Tr ("error flashing the board: %v" , err ), feedback .ErrBadArgument )
9898 }
0 commit comments