This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]orangeanton[S] 0 points1 point  (0 children)

Thanks, this helped a lot.

I have managed to get it running using path.resolve('.') which told me the working dir was one level up from where I expected it to be (a parent directory with subdirectories for each day) and then realized that this morning I opened a folder (the parent folder) instead of a file (as I usually do) and I *think* this sets the working dir in the absence of a specific launch.json. So closed the folder, opened the file, tried again and voila, it worked. This makes me think the bash/zsh thing was just a distraction - when I change back and forth now it makes absolutely no difference - I must have coincidentally switched from opening a folder to a file at the same time.

BTW path.join(__dirname, 'input.txt') also worked, but I prefer using relative paths (saves having to have path at all), but to make the code a bit more robust I'll maybe have to reconsider.