-
Notifications
You must be signed in to change notification settings - Fork 312
Open
Labels
Description
Let's say I have a local image file called my-code-doesnt-work.jpg
alongside my markdown slide and I simply add it to the slide like this:
---
# Title

---
When I executed the converter, error message popped out as follows:
Unable to generate slides: { [Error: ENOENT: no such file or directory, open 'c:\c:\git\others\not-so-personal-notes\Stretch\slides\my-code-doesnt-work.jpg']
After some hacking I was able to pinpoint the cause to this line of code:
https://github.com/gsuitedevs/md2googleslides/blob/master/src/images/probe.ts#L62
I used console.log
to print the parsedUrl.pathname
and the result was
/c:/git/others/not-so-personal-notes/Stretch/slides/my-code-doesnt-work.jpg
Then it was passed to fs.createReadStream(path);
and that's where the error came from.
I can hack it to resolve my issue by using fs.createReadStream(path.substring(1));
but obviously it's not an ideal solution and I have no idea whether it will affect macos / linux or not.
Any ideas?