File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -267,7 +267,6 @@ impl Bridge {
267267 None => return Ok ( ( ) ) ,
268268 } ;
269269 let mut path = self . config . persistence_path . clone ( ) ;
270- fs:: create_dir_all ( & path) ?;
271270 path. push ( "current_action" ) ;
272271 info ! ( "Storing current action in persistence; path: {}" , path. display( ) ) ;
273272 current_action. write_to_disk ( path) ?;
Original file line number Diff line number Diff line change @@ -158,6 +158,14 @@ pub mod config {
158158
159159 let mut config: Config = config. try_deserialize ( ) ?;
160160
161+ // Create directory at persistence_path if it doesn't already exist
162+ fs:: create_dir_all ( & config. persistence_path ) . map_err ( |_| {
163+ anyhow:: Error :: msg ( format ! (
164+ "Permission denied for creating persistence directory at \" {}\" " ,
165+ config. persistence_path. display( )
166+ ) )
167+ } ) ?;
168+
161169 // replace placeholders with device/tenant ID
162170 let tenant_id = config. project_id . trim ( ) ;
163171 let device_id = config. device_id . trim ( ) ;
Original file line number Diff line number Diff line change @@ -68,6 +68,7 @@ fn banner(commandline: &CommandLine, config: &Arc<Config>) {
6868 println ! ( " project_id: {}" , config. project_id) ;
6969 println ! ( " device_id: {}" , config. device_id) ;
7070 println ! ( " remote: {}:{}" , config. broker, config. port) ;
71+ println ! ( " persistence_path: {}" , config. persistence_path. display( ) ) ;
7172 if !config. action_redirections . is_empty ( ) {
7273 println ! ( " action redirections:" ) ;
7374 for ( action, redirection) in config. action_redirections . iter ( ) {
You can’t perform that action at this time.
0 commit comments