Skip to content
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

Problem with WSL path #18

Closed
aileo opened this issue May 12, 2020 · 1 comment · Fixed by #19
Closed

Problem with WSL path #18

aileo opened this issue May 12, 2020 · 1 comment · Fixed by #19

Comments

@aileo
Copy link

aileo commented May 12, 2020

I am using this package through email-templates in a WSL environment. It opens chrome for the WSL as explained here, but it does not open the html generated file.

I specified a path like /mnt/c/... for dir option so both windows and WSL can access. It writes the html correctly, but does not load the page in chrome.

I think it is due to chrome on windows that does not understand WSL formatted path, I tested replacing this by:

if (options.open) await open(filePath.replace('/mnt/c', 'C:').replace('/', '\\'), options.open);

and it worked as expected (but it is not reliable at all).

I don't know if it is really an issue with this package or if it should be supported... Maybe just adding an option that takes a function to transform path to give to open could do the job at a minimal cost.

@niftylettuce
Copy link
Collaborator

I would gladly accept a PR and possibly tests too if you don't mind. Thanks @aileo

aileo pushed a commit to aileo/preview-email that referenced this issue May 12, 2020
- Allow to pass a function to tranform file path to url
   - can transform WSL path to windows path if needed
- url provided to `open` instead of local path to allow usage of http (output files could be written to a served directory)

should fix forwardemail#18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants