File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 1
1
import os
2
2
import json
3
3
import sys
4
- os .chdir ('/' )
5
4
6
5
def get_root (has_flash_mount = True ):
7
6
if '/flash' in sys .path :
8
- print ( '/flash' , end = '' )
7
+ return '/flash'
9
8
else :
10
- print ( '/' , end = '' )
9
+ return '/'
11
10
12
11
def is_directory (path ):
13
12
return True if os .stat (path )[0 ] == 0x4000 else False
@@ -26,6 +25,9 @@ def get_all_files(path, array_of_files = []):
26
25
return array_of_files
27
26
28
27
28
+ def iget_root ():
29
+ print (get_root (), end = '' )
30
+
29
31
def ilist_all (path ):
30
32
print (json .dumps (get_all_files (path )))
31
33
@@ -38,3 +40,5 @@ def delete_folder(path):
38
40
if file ['type' ] == 'folder' :
39
41
os .rmdir (file ['path' ])
40
42
os .rmdir (path )
43
+
44
+ os .chdir (get_root ())
Original file line number Diff line number Diff line change @@ -1694,7 +1694,7 @@ async function getAvailablePorts() {
1694
1694
1695
1695
async function getBoardRoot ( ) {
1696
1696
let output = await serialBridge . execFile ( await getHelperFullPath ( ) )
1697
- output = await serialBridge . run ( `get_root ()` )
1697
+ output = await serialBridge . run ( `iget_root ()` )
1698
1698
let boardRoot = ''
1699
1699
try {
1700
1700
// Extracting the json output from serial response
You can’t perform that action at this time.
0 commit comments