Skip to content

Throws "image_output_path folder did not exist and could not be created" in multi-volume setup #180

@awesomephant

Description

@awesomephant

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:

Error dialogue reading 'Could not write this file / The file was not found' Error dialogue reading 'The image_output_path folder did not exist and could not be creted'

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions