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

Improve shell script arguments handling #33

Open
fluidblue opened this issue Nov 29, 2013 · 9 comments
Open

Improve shell script arguments handling #33

fluidblue opened this issue Nov 29, 2013 · 9 comments
Assignees

Comments

@fluidblue
Copy link

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
Copy link
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
@fluidblue
Copy link
Author

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
Copy link
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.

@fluidblue
Copy link
Author

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
Copy link
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
@boxxxie
Copy link

boxxxie commented Jun 7, 2023

please update the docs with examples of how to use the command line args. it's not obvious that the args should be used in the way you describe in this issue.

i've run into this issue as well, but with different arguments (sourcemap).

@medikoo
Copy link
Owner

medikoo commented Jun 9, 2023

@boxxxie in documentation, there's a command line name for each option provided: https://github.com/medikoo/modules-webmake#options, e.g.:

Screenshot 2023-06-09 at 10 53 54

How would you improve it?

@boxxxie
Copy link

boxxxie commented Jun 9, 2023

examples, like how man files give a few examples of command use.

in this case, i have no idea how to use sourcemap when writing my script. do i do -- sourcemap -sourcemap --sourcemap or just sourcemap

@medikoo
Copy link
Owner

medikoo commented Jun 11, 2023

@boxxxie this falls into general knowledge on construction of CLI params. Follow: https://betterdev.blog/command-line-arguments-anatomy-explained/

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

3 participants