@@ -1490,7 +1490,7 @@ function canEdit({ selectedFiles }) {
1490
1490
1491
1491
async function removeBoardFolder ( fullPath ) {
1492
1492
// TODO: Replace with getting the file tree from the board and deleting one by one
1493
- let output = await serial . execFile ( './ui/arduino/helpers.py' )
1493
+ let output = await serial . execFile ( await getHelperFullPath ( ) )
1494
1494
await serial . run ( `delete_folder('${ fullPath } ')` )
1495
1495
}
1496
1496
@@ -1522,7 +1522,7 @@ async function uploadFolder(srcPath, destPath, dataConsumer) {
1522
1522
async function downloadFolder ( srcPath , destPath , dataConsumer ) {
1523
1523
dataConsumer = dataConsumer || function ( ) { }
1524
1524
await disk . createFolder ( destPath )
1525
- let output = await serial . execFile ( './ui/arduino/helpers.py' )
1525
+ let output = await serial . execFile ( await getHelperFullPath ( ) )
1526
1526
output = await serial . run ( `ilist_all('${ srcPath } ')` )
1527
1527
let files = [ ]
1528
1528
try {
@@ -1550,3 +1550,20 @@ async function downloadFolder(srcPath, destPath, dataConsumer) {
1550
1550
}
1551
1551
}
1552
1552
}
1553
+
1554
+ async function getHelperFullPath ( ) {
1555
+ const appPath = await disk . getAppPath ( )
1556
+ if ( await win . isPackaged ( ) ) {
1557
+ return disk . getFullPath (
1558
+ appPath ,
1559
+ '..' ,
1560
+ 'ui/arduino/helpers.py'
1561
+ )
1562
+ } else {
1563
+ return disk . getFullPath (
1564
+ appPath ,
1565
+ 'ui/arduino/helpers.py' ,
1566
+ ''
1567
+ )
1568
+ }
1569
+ }
0 commit comments