File tree 2 files changed +19
-16
lines changed
2 files changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -102,10 +102,11 @@ class WebWorkflow extends Workflow {
102
102
} else {
103
103
return Error ( "You are connected with localhost, but didn't supply the device hostname." ) ;
104
104
}
105
- } else if ( isMdns ( ) ) {
106
- this . host = location . hostname ;
107
- } else if ( isIp ( ) ) {
105
+ } else if ( isMdns ( ) || isIp ( ) ) {
108
106
this . host = location . hostname ;
107
+ if ( location . port != 80 ) {
108
+ this . host += ":" + location . port ;
109
+ }
109
110
}
110
111
111
112
if ( this . host != null ) {
Original file line number Diff line number Diff line change @@ -205,22 +205,24 @@ class Workflow {
205
205
206
206
if ( path == "/code.py" ) {
207
207
await this . serialTransmit ( CHAR_CTRL_D ) ;
208
- }
208
+ } else {
209
209
210
- let extension = path . split ( '.' ) . pop ( ) ;
211
- if ( extension === null ) {
212
- console . log ( "Extension not found" ) ;
213
- return false ;
214
- }
215
- if ( String ( extension ) . toLowerCase ( ) != "py" ) {
216
- console . log ( "Extension not py, twas " + String ( extension ) . toLowerCase ( ) ) ;
217
- return false ;
218
- }
219
- path = path . slice ( 0 , - 3 ) ;
220
- path = path . replace ( / \/ / g, "." ) ;
210
+ let extension = path . split ( '.' ) . pop ( ) ;
211
+ if ( extension === null ) {
212
+ console . log ( "Extension not found" ) ;
213
+ return false ;
214
+ }
215
+ if ( String ( extension ) . toLowerCase ( ) != "py" ) {
216
+ console . log ( "Extension not py, it was " + String ( extension ) . toLowerCase ( ) ) ;
217
+ return false ;
218
+ }
221
219
220
+ path = path . slice ( 1 , - 3 ) ;
221
+ path = path . replace ( / \/ / g, "." ) ;
222
+
223
+ await this . serialTransmit ( CHAR_CTRL_C + "import " + path + CHAR_CRLF ) ;
224
+ }
222
225
await this . _changeMode ( MODE_SERIAL ) ;
223
- await this . serialTransmit ( CHAR_CTRL_C + "import " + path + CHAR_CRLF ) ;
224
226
}
225
227
226
228
async checkSaved ( ) {
You can’t perform that action at this time.
0 commit comments