@@ -1490,7 +1490,7 @@ function canEdit({ selectedFiles }) {
14901490
14911491async function removeBoardFolder ( fullPath ) {
14921492 // 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 ( ) )
14941494 await serial . run ( `delete_folder('${ fullPath } ')` )
14951495}
14961496
@@ -1522,7 +1522,7 @@ async function uploadFolder(srcPath, destPath, dataConsumer) {
15221522async function downloadFolder ( srcPath , destPath , dataConsumer ) {
15231523 dataConsumer = dataConsumer || function ( ) { }
15241524 await disk . createFolder ( destPath )
1525- let output = await serial . execFile ( './ui/arduino/helpers.py' )
1525+ let output = await serial . execFile ( await getHelperFullPath ( ) )
15261526 output = await serial . run ( `ilist_all('${ srcPath } ')` )
15271527 let files = [ ]
15281528 try {
@@ -1550,3 +1550,20 @@ async function downloadFolder(srcPath, destPath, dataConsumer) {
15501550 }
15511551 }
15521552}
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