File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -196,7 +196,11 @@ function tryToQuit() {
196
196
}
197
197
198
198
var maxLineNumber = 0 ;
199
- function sendFile ( fileName ) {
199
+ function sendFile ( fileName , exitWhenDone ) {
200
+ if ( exitWhenDone == null ) {
201
+ exitWhenDone = false ;
202
+ }
203
+
200
204
function startSendFile ( ) {
201
205
sendingFile = true ;
202
206
g . sendFile ( fileName || process . stdin , function ( err ) {
@@ -210,16 +214,15 @@ function sendFile(fileName) {
210
214
sendingFile = false ;
211
215
maxLineNumber = 0 ;
212
216
213
- // FIX THIS!!
214
- // if (rl !== null) {
215
- // rl.close();
216
- // // rl = null;
217
- // }
218
217
// log("closing...");
219
- if ( ! interactive ) {
220
- g . close ( ) ;
221
- }
218
+ if ( exitWhenDone == true ) {
219
+ if ( rl !== null ) {
220
+ rl . close ( ) ;
221
+ rl = null ;
222
222
223
+ g . close ( ) ;
224
+ }
225
+ }
223
226
} ) ;
224
227
}
225
228
@@ -439,7 +442,7 @@ function openTinyG() {
439
442
}
440
443
441
444
if ( args . gcode || ! process . stdin . isTTY ) {
442
- sendFile ( args . gcode || process . stdin ) ;
445
+ sendFile ( args . gcode || process . stdin , true ) ;
443
446
}
444
447
}
445
448
You can’t perform that action at this time.
0 commit comments