I'm using this library from preview-email
library and it fails to open the generated html file on WSL
I have found a partial solution but missing a code to differentiate between a Web URL or a filesystem path
} else if (process.platform === 'win32' || isWsl) {
command = 'cmd' + (isWsl ? '.exe' : '');
cliArguments.push('/c', 'start', '""', '/b');
target = target.replace(/&/g, '^&');
if (options.wait) {
cliArguments.push('/wait');
}
if (options.app) {
if (isWsl && options.app.startsWith('/mnt/')) {
const windowsPath = await wslToWindowsPath(options.app);
options.app = windowsPath;
}
cliArguments.push(options.app);
}
// Convert local filepath to the one windows can understand
// Needs to differentiate between web url and filepath
if (isWsl) {
target = await wslToWindowsPath(target);
}
if (appArguments.length > 0) {
cliArguments.push(...appArguments);
}
} else {
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too