File tree 1 file changed +7
-0
lines changed
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(
111
111
) -> Result < ( ) , AssetsWatchError > {
112
112
use assets_watch_error:: * ;
113
113
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
+
114
118
let ( tx, rx) = mpsc:: channel ( ) ;
115
119
116
120
let mut watcher = notify:: recommended_watcher ( move |evt : notify:: Result < notify:: Event > | {
@@ -142,6 +146,9 @@ fn do_assets_watch(
142
146
#[ derive( Debug , Snafu ) ]
143
147
#[ snafu( module) ]
144
148
enum AssetsWatchError {
149
+ #[ snafu( display( "Could not create the asset directory" ) ) ]
150
+ AssetDirectoryCreate { source : io:: Error , path : PathBuf } ,
151
+
145
152
#[ snafu( display( "Could not create the filesystem watcher" ) ) ]
146
153
WatcherCreate { source : notify:: Error } ,
147
154
You can’t perform that action at this time.
0 commit comments