I am building my app on windows.
I am trying to do some path manipulation using the path module.
I have done this:
import { app, BrowserWindow } from 'electron'
import path;
console.log('path.sep:', path.sep);
It is giving me /
but that is wrong. It should should be \
as I am on windows. This is the same reason I got this bug here - path.dirname on Windows path is giving `.` - but no one mentioned that to me.
Does anyone know how to make path
module properly work on Windows in electron?
Is the only solution this:
import pathOrig from 'path'
import url from 'url'
import os from 'os'
const PLATFORM = os.platform();
const path = PLATFORM.startsWith('win') ? pathOrig.win32 : pathOrig;