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

CLI doesn't work #389

Closed
ben-page opened this issue Sep 28, 2016 · 3 comments
Closed

CLI doesn't work #389

ben-page opened this issue Sep 28, 2016 · 3 comments

Comments

@ben-page
Copy link
Contributor

I'm using mermaid v6.0.0 on Windows 10 using Node.js v6.7.0. I can't get the CLI to work at all.

Setup
> npm -g install mermaid phantomjs-prebuilt
> curl -O https://raw.githubusercontent.com/knsv/mermaid/master/test/fixtures/test.mermaid

options before file

--help says options come before the files (Usage: mermaid [options] <file>...)

>mermaid -w 600 -v test.mermaid
You had errors in your syntax. Use --help for further information.
You must specify at least one source file.

file before options

Try it the other way around.

> mermaid test.mermaid -w 600 -v 
Num files to execute : 0

no options

Try it the other way around.

> mermaid test.mermaid 
Num files to execute : 0
@ben-page
Copy link
Contributor Author

So there are two problems.

First, the verbose argument (-v) is not configured to be a boolean, so it's swallowing the next argument. So in the case of mermaid -v file.mmd the file.mmd is being interpreted as the value of the verbose argument.

Second, when cli.js spawns phantomjs it's passing the css, sequenceConfig, and ganttConfig values as buffers. It looks like the author may have intended to pass them as strings (the encoding is incorrectly specified), but that wont necessarily work either. The string would need to be escaped for the shell.

@ben-page
Copy link
Contributor Author

My PR fixes both issues.

First, it sets verbose to be a boolean argument.

Second, rather than passing the contents of the css, sequenceConfig, and ganttConfig to phantonjs, the path of the file is sent. And phantomscript.js has been updated to load the files.

@knsv
Copy link
Collaborator

knsv commented Jan 29, 2017

Closed by release 7.0.0, please reopen if issues remain.

@knsv knsv closed this as completed Jan 29, 2017
mgenereu pushed a commit to mgenereu/mermaid that referenced this issue Jun 25, 2022
…yarn/develop/postcss-8.3.7

chore(deps-dev): bump postcss from 8.3.6 to 8.3.7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants