Research
This commit is contained in:
parent
52909f6f21
commit
cb73bc143d
1 changed files with 13 additions and 0 deletions
|
@ -11,6 +11,19 @@ export const isDev = !app.isPackaged;
|
|||
/**
|
||||
* Convert a file system {@link filePath} that uses the local system specific
|
||||
* path separators into a path that uses POSIX file separators.
|
||||
*
|
||||
* For all paths that we persist or pass over the IPC boundary, we always use
|
||||
* POSIX paths, even on Windows.
|
||||
*
|
||||
* Windows recognizes both forward and backslashes. This also works with drive
|
||||
* names. c:\foo\bar and c:/foo/bar are both valid.
|
||||
*
|
||||
* > Almost all paths passed to Windows APIs are normalized. During
|
||||
* > normalization, Windows performs the following steps: ... All forward
|
||||
* > slashes (/) are converted into the standard Windows separator, the back
|
||||
* > slash (\).
|
||||
* >
|
||||
* > https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats
|
||||
*/
|
||||
export const posixPath = (filePath: string) =>
|
||||
filePath.split(path.sep).join(path.posix.sep);
|
||||
|
|
Loading…
Add table
Reference in a new issue