1 parent d1db369 commit 32764c3Copy full SHA for 32764c3
1 file changed
utils/misc/nodejs-terminal/html/webcontainer-fs/webcontainer-fs.html
@@ -168,15 +168,28 @@
168
169
btn.load = function(){
170
171
-
172
- console.json(filenav.cur);
+ if(!filenav.cur.name){
+ log.red('no file selected');
173
+ return;
174
+ }
175
+
176
+ var abs = filenav.cur.path+filenav.cur.name;
177
+ var uint8 = await webcontainer.fs.readFile(abs);
178
+ var blob = new Blob([uint8]);
179
180
+ var file = newfile({abs,name});
181
+ complete.load(file,blob);
182
183
}//load
184
185
186
btn.save = async function(){
187
188
189
190
191
192
193
var blob = await source();
194
var buf = await blob.arrayBuffer();
195
var uint8 = new Uint8Array(buf);
0 commit comments