Skip to content

Commit 9e803c2

Browse files
save file
1 parent 123da8a commit 9e803c2

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

utils/misc/nodejs-terminal/html/snippet-nodejs/v1.0/snippet-nodejs-v1.0.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,11 @@
169169

170170
btn.run = async function(){
171171

172+
if(process){
173+
term.log('process running');
174+
return;
175+
}
176+
172177
var js = editor.get();
173178
run(js);
174179

@@ -198,8 +203,12 @@
198203

199204

200205

201-
function run(js){
206+
async function run(js){
202207

208+
if(process){
209+
return false;
210+
}
211+
203212
await webcontainer.fs.writeFile(tmpfile,js);
204213

205214
if(!chk.persist.checked){
@@ -222,6 +231,7 @@
222231
process.output.pipeTo(stream)
223232

224233
var code = await process.exit;
234+
process = null;
225235

226236
term.log('process exited :',code);
227237
if(chk.echo.checked){

0 commit comments

Comments
 (0)