@@ -163,6 +163,7 @@ export class FileSystemDrive implements Contents.IDrive {
163
163
let localPath = PathExt . basename ( path ) ;
164
164
const name = localPath ;
165
165
166
+ let data : Contents . IModel ;
166
167
if ( type === 'directory' ) {
167
168
let i = 1 ;
168
169
while ( await this . hasHandle ( parentHandle , localPath ) ) {
@@ -171,7 +172,7 @@ export class FileSystemDrive implements Contents.IDrive {
171
172
172
173
await parentHandle . getDirectoryHandle ( localPath , { create : true } ) ;
173
174
174
- return this . get ( PathExt . join ( parentPath , localPath ) ) ;
175
+ data = await this . get ( PathExt . join ( parentPath , localPath ) ) ;
175
176
} else {
176
177
let i = 1 ;
177
178
while ( await this . hasHandle ( parentHandle , `${ localPath } .${ ext } ` ) ) {
@@ -182,12 +183,28 @@ export class FileSystemDrive implements Contents.IDrive {
182
183
183
184
await parentHandle . getFileHandle ( filename , { create : true } ) ;
184
185
185
- return this . get ( PathExt . join ( parentPath , filename ) ) ;
186
+ data = await this . get ( PathExt . join ( parentPath , filename ) ) ;
186
187
}
188
+
189
+ this . _fileChanged . emit ( {
190
+ type : 'new' ,
191
+ oldValue : null ,
192
+ newValue : data
193
+ } ) ;
194
+
195
+ return data ;
187
196
}
188
197
189
- delete ( path : string ) : Promise < void > {
190
- throw new Error ( 'Method not implemented.' ) ;
198
+ async delete ( path : string ) : Promise < void > {
199
+ const parentHandle = await this . getParentHandle ( path ) ;
200
+
201
+ await parentHandle . removeEntry ( PathExt . basename ( path ) , { recursive : true } ) ;
202
+
203
+ this . _fileChanged . emit ( {
204
+ type : 'delete' ,
205
+ oldValue : { path : path } ,
206
+ newValue : null
207
+ } ) ;
191
208
}
192
209
193
210
rename ( oldPath : string , newPath : string ) : Promise < Contents . IModel > {
0 commit comments