Improve shell script arguments handling #33

Open
fluidblue opened this Issue Nov 29, 2013 · 5 comments

Comments

Projects
None yet
2 participants

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'
Owner

medikoo commented Nov 29, 2013

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

@ghost ghost assigned medikoo Nov 29, 2013

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'
Owner

medikoo commented Dec 2, 2013

@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.

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.

Owner

medikoo commented Dec 2, 2013

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

medikoo added a commit that referenced this issue Dec 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment