Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asciidoctorj gives error if input file is an absolute path #275

Closed
enr opened this issue Jan 30, 2015 · 6 comments
Closed

Asciidoctorj gives error if input file is an absolute path #275

enr opened this issue Jan 30, 2015 · 6 comments
Labels

Comments

@enr
Copy link

enr commented Jan 30, 2015

Hi,

I have error if I pass the input file as an absolute path, but using relative path everything is ok.

Asciidoctorj version (installed via GVM):

enrico@lap:~/union/feasibility-docs/developers-manual$ asciidoctorj --version
Asciidoctor 1.5.2 [http://asciidoctor.org]

The failing command:

enrico@lap:~/union/feasibility-docs/developers-manual$ asciidoctorj --backend html5 \
--destination-dir /home/enrico/union/feasibility-docs/developers-manual/build \
--out-file index.html --doctype book --attribute project-version=0.1 \
/home/enrico/union/feasibility-docs/developers-manual/src/asciidoc/index.adoc
asciidoctor: FAILED: input file(s) '[/home/enrico/union/feasibility-docs/developers-manual/src/asciidoc/index.adoc]' missing or cannot be read
Exception in thread "main" java.lang.IllegalArgumentException: asciidoctor: FAILED: input file(s) '[/home/enrico/union/feasibility-docs/developers-manual/src/asciidoc/index.adoc]' missing or cannot be read
at org.asciidoctor.cli.AsciidoctorInvoker.invoke(AsciidoctorInvoker.java:51)
at org.asciidoctor.cli.AsciidoctorInvoker.main(AsciidoctorInvoker.java:184)

The input file exists:

enrico@lap:~/union/feasibility-docs/developers-manual$ ll /home/enrico/union/feasibility-docs/developers-manual/src/asciidoc/index.adoc
-rw-rw-r-- 1 enrico enrico 288 gen 27 16:39 /home/enrico/union/feasibility-docs/developers-manual/src/asciidoc/index.adoc

The successful command (change only the input file path, from absolute to relative):

enrico@lap:~/union/feasibility-docs/developers-manual$ asciidoctorj --backend html5 \
--destination-dir /home/enrico/union/feasibility-docs/developers-manual/build \
--out-file index.html --doctype book --attribute project-version=0.1 \
src/asciidoc/index.adoc

Is this expected?

Anyway, thanks a lot for this awesome tool!

Enrico

@lordofthejars
Copy link
Member

At least this is not the expected behaviour, we are going to check why this happens and fix it.

Thank you very much for using asciidoctor.

@enr
Copy link
Author

enr commented Jan 30, 2015

Ok, let me know if you need help to reproduce the problem or test the fix :)
Cheers

@mojavelinux
Copy link
Member

I get the same result. Seems to happen even for a simple invocation with an absolute path:

$ asciidoctorj /tmp/article.adoc

Results in:

asciidoctor: FAILED: input file(s) '[/tmp/article.adoc]' missing or cannot be read
Exception in thread "main" java.lang.IllegalArgumentException: asciidoctor: FAILED: input file(s) '[/tmp/article.adoc]' missing or cannot be read
    at org.asciidoctor.cli.AsciidoctorInvoker.invoke(AsciidoctorInvoker.java:51)
    at org.asciidoctor.cli.AsciidoctorInvoker.main(AsciidoctorInvoker.java:184)

robertpanzer added a commit to robertpanzer/asciidoctorj that referenced this issue Mar 14, 2015
Absolute paths are split into an absolute part without wildcards that serves as the root directory and a relative part containing wildcards or at least the file name.
Relative paths are still handled as being reachable from current working dir.
@lordofthejars lordofthejars reopened this Mar 18, 2015
@lordofthejars
Copy link
Member

Fixed in master, now we need to rebase to asciidoctorj1.6.0 branch.

robertpanzer added a commit to robertpanzer/asciidoctorj that referenced this issue Mar 18, 2015
Absolute paths are split into an absolute part without wildcards that serves as the root directory and a relative part containing wildcards or at least the file name.
Relative paths are still handled as being reachable from current working dir.
@mojavelinux
Copy link
Member

👍

@robertpanzer
Copy link
Member

Also fixed on asciidoctorj-1.6.0 with 0f9cb5b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants