I have two volumes. Illustrator is installed on C, my project file lives on D. When I run ai2html against the project file, I get the following errors:
I think this is caused by pathJoin() cutting off the leading slash in docPath (and anything else that is passed to it), causing Illustrator to read d as a regular folder instead of a volume designator.
I've fixed problem locally but I'm unsure if this has side effects elsewhere:
// Similar to Node.js path.join()
function pathJoin() {
var path = '';
- forEach(arguments, function(arg) {
+ forEach(arguments, function(arg, i) {
if (!arg) return;
arg = String(arg);
- arg = arg.replace(/^\/+/, '').replace(/\/+$/, '');
+ if (i > 0) {
+ arg.replace(/^\/+/, ""); // leading slash
+ }
+ arg = arg.replace(/\/+$/, ""); // trailing slash
if (path.length > 0) {
path += '/';
}
path += arg;
});
return path;
}
For what it's worth this also brings the method's behaviour in line with Node's path.join().
(Windows 10, Illustrator 27.8)
I have two volumes. Illustrator is installed on
C, my project file lives onD. When I run ai2html against the project file, I get the following errors:I think this is caused by
pathJoin()cutting off the leading slash indocPath(and anything else that is passed to it), causing Illustrator to readdas a regular folder instead of a volume designator.I've fixed problem locally but I'm unsure if this has side effects elsewhere:
// Similar to Node.js path.join() function pathJoin() { var path = ''; - forEach(arguments, function(arg) { + forEach(arguments, function(arg, i) { if (!arg) return; arg = String(arg); - arg = arg.replace(/^\/+/, '').replace(/\/+$/, ''); + if (i > 0) { + arg.replace(/^\/+/, ""); // leading slash + } + arg = arg.replace(/\/+$/, ""); // trailing slash if (path.length > 0) { path += '/'; } path += arg; }); return path; }For what it's worth this also brings the method's behaviour in line with Node's
path.join().(Windows 10, Illustrator 27.8)