-
-
Notifications
You must be signed in to change notification settings - Fork 37
Bugfix/windows path #53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the improvements in Windows VM and it works.
No regressions introduced to Mac
fixes #50 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fixes on Windows. Please go ahead with the merge, and let's revisit the path handling later.
Problem:
File management and navigation on Windows wasn't working because of different path separators and root.
The previous solution of using
cleanPath
on the front end to normalize the path strings.The path strings is calculated using four state properties:
diskPath
: The full path of the "working folder" on your diskdiskNavigation
: Tells the current folder you are, relative todiskPath
serialPath
: The serial port pathserialNavigation
: Tells the current folder you are, relative to `serialPathSolution:
Instead of storing the serial port path on
serialPath
, that is now stored onserialPort
.serialPath
is now always/
since you can't choose a folder inside of your board to be the "working folder"The function
cleanPath
was replaced by 3 different methods in theSerial
andDisk
objects declared onpreload.js
.The 3 methods are:
getFullPath(root, navigation, file)
: It's going to return the full resolved pathgetNavigationPath(navigation, target)
: Safely concatenate thetarget
to currentnavigation
getParentPath(filePath)
: Returns the parent path of a file or folder.On
Serial
we can always assume UNIX-like filesystem so most of the methods will be basic string manipulation.On
Disk
we use node'spath
module to comply to OS specification.All
ipcMain
methods expect now a fully resolved file/folder path.Extra:
Improve speed of downloading files without unsaved changes by simply saving the current editor content on disk.