File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -123,11 +123,22 @@ export class FileSystemDrive implements Contents.IDrive {
123
123
throw new Error ( 'Method not implemented.' ) ;
124
124
}
125
125
126
- save (
126
+ async save (
127
127
localPath : string ,
128
128
options ?: Partial < Contents . IModel >
129
129
) : Promise < Contents . IModel > {
130
- throw new Error ( 'Method not implemented.' ) ;
130
+ const root = this . _rootHandle ;
131
+
132
+ if ( ! root ) {
133
+ throw new Error ( 'No root file handle' ) ;
134
+ }
135
+
136
+ const handle = await root . getFileHandle ( localPath ) ;
137
+ const writable = await handle . createWritable ( { } ) ;
138
+ const content = options ?. content ;
139
+ await writable . write ( content ) ;
140
+ await writable . close ( ) ;
141
+ return this . get ( localPath ) ;
131
142
}
132
143
133
144
copy ( localPath : string , toLocalDir : string ) : Promise < Contents . IModel > {
You can’t perform that action at this time.
0 commit comments