Closed Marie-P closed 3 years ago
The .DS_Store file stores the settings for folders on Mac. I don't know why this happens, but I do have an idea. The script itself goes through all the files in the directory when you run "npm run convert". A possible solution would be to have the script ignore anything that has to do with .DS_Store
That'll probably look something like (on line 23):
function getfiles(dir) {
if (dir != ".DS_Store"){
var files = fs.readdirSync(dir);
var i = 0;
while (i < files.length) {
var now = getSecondPart(files[i]);
if (now == 'md') {
convert(files[i], dir);
} else {
getfiles(dir + '/' + files[i]);
}
i++;
}
}
}
This script just ignores anything to do with .DS_Store. If you can please try replacing the function at line 23 in index.js with the one provided, and tell me if that works. If it does, I'll update the script.
No wait, that script won't work. The if statement would be in the while loop.
Hello,
I tried with the if statement in the while loop, and it doesn't work.
The command find site/markdown -name .DS_Store -exec rm {} \;
can fix the problem; it's delete .DS_store
files in site/markdown.
I also got the same issue and it worked.
Thanks, this way seems to tackle the issue head-on. @Marie-P tell me if it doesn't work.
Yes it's seems to work :ok_hand: thank you.
Hello,
I got an error on macOS Big Sur (11.2) when I execute on terminal
npm run serve
. It's related to the file specific to macOSsite/markdown/.DS_Store
.