File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -111,6 +111,10 @@ fn do_assets_watch(
111111) -> Result < ( ) , AssetsWatchError > {
112112 use assets_watch_error:: * ;
113113
114+ // The directory needs to exist before we can watch it.
115+ std:: fs:: create_dir_all ( & asset_root)
116+ . context ( AssetDirectoryCreateSnafu { path : & asset_root } ) ?;
117+
114118 let ( tx, rx) = mpsc:: channel ( ) ;
115119
116120 let mut watcher = notify:: recommended_watcher ( move |evt : notify:: Result < notify:: Event > | {
@@ -142,6 +146,9 @@ fn do_assets_watch(
142146#[ derive( Debug , Snafu ) ]
143147#[ snafu( module) ]
144148enum AssetsWatchError {
149+ #[ snafu( display( "Could not create the asset directory" ) ) ]
150+ AssetDirectoryCreate { source : io:: Error , path : PathBuf } ,
151+
145152 #[ snafu( display( "Could not create the filesystem watcher" ) ) ]
146153 WatcherCreate { source : notify:: Error } ,
147154
You can’t perform that action at this time.
0 commit comments