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

Add a missing potrace help message. #104

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,20 @@ function fontCssPipe() {

function bmp2svg() {
return through.obj(function(file, enc, next) {

var potraceProcess = child_process.spawn(
'potrace', ['-o', '-', '-b', 'svg'], {
stdio: [ 'pipe', 'pipe', 'inherit' ]
}
);
potraceProcess.on("error", () => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm reading this correctly, we'll get this message for any error when invoking potrace. Is it possible to handle ENOENT specifically here?

console.error(`
Could not run \`potrace\`.
Please ensure that the \`potrace\` binary is available on your \`$PATH\`. For example, install using one of the following:

- apt install potrace (on Linux)
- brew install potrace (on macOS using Homebrew)
`)
});

potraceProcess.stdin.write(file.contents);
potraceProcess.stdin.end();
Expand Down