Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Improve shell script arguments handling #33

Open
fluidblue opened this Issue · 5 comments

2 participants

@fluidblue

When switching on ignoreErrors with --ignoreerrors, an ENOENT error occurs.
Without the --ignoreerrors, everything is working fine.

Example:

mkdir -p ./build/httpdocs/js
webmake --ext=coffee --ignoreerrors ./src/js/gui/passdeposit.coffee ./build/httpdocs/js/passdeposit.js

results in

/usr/local/lib/node_modules/webmake/node_modules/deferred/lib/_ext.js:71
            throw this.value;
                      ^
Error: ENOENT, open '/Users/max/Desktop/PassDeposit/build/httpdocs/js/passdeposit.js'
@medikoo
Owner

Can you prepare some good test case, that would reproduce that on my side? I haven't seen issues using ignoreErrors option.

@medikoo medikoo was assigned
@fluidblue

I created a test: https://github.com/fluidblue/webmake-test

When you execute make, webmake is called without --ignoreerrors and everything is fine. When executing make test, webmake is called with --ignoreerrors and it throws an error like this:

webmake --ext=coffee --ignoreerrors ./src/test.coffee ./build/test.js

/usr/local/lib/node_modules/webmake/node_modules/deferred/lib/_ext.js:71
            throw this.value;
                      ^
Error: ENOENT, open '/Users/max/Desktop/webmake-test/build/test.js'
@medikoo
Owner

@fluidblue thanks.

Issue lies in your build script, you call: webmake --ext=coffee --ignoreerrors ./src/test.coffee ./build/test.js, which translates to webmake('./build/test.js', { ext: 'coffee', sourceMap: false, ignoreErrors: false }).

Thing is that it should be --ignore-errors, not --ignoreerrors. Latter is unrecognized option, and argument that follows that is taken as its value (it's swallowed).

I'll rename this issue, to "Improve shell script arguments handling", and leave it open until we have it more bulletproof so such errors doesn't come as unnoticed.

@fluidblue

Ah I see. Now it works.

It is a little bit confusing, that the sourceMap option is --sourcemap on the commandline whereas ignoreErrors is --ignore-errors

It might be helpful to include the commandline equivalents in the options documentation.

@medikoo
Owner

@fluidblue that's true, it's not consistent. I'll probably fix this and assure consistency from v0.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.