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

Error attempting to use lein-doo 0.1.7 #120

Open
ricardojmendez opened this issue Oct 8, 2016 · 3 comments
Open

Error attempting to use lein-doo 0.1.7 #120

ricardojmendez opened this issue Oct 8, 2016 · 3 comments

Comments

@ricardojmendez
Copy link

Get the following assertion error when attempting to run lein with-profile test doo phantom with plugin 0.1.7:

(not (and (default? cli-alias) (not (contains? alias-map :default))))

Version 0.1.6 of the plugin works just fine. Configuration is simply :doo {:build "test"}

@MatthewDarling
Copy link
Contributor

Skimming the responsible code a bit, it seems like that assertion is meant to catch not specifying an environment (lein doo, without setting a default) or an invalid environment (lein doo foo).

phantom should be a valid environment alias, though.

Do you have an example repository that shows this behaviour?

@miikka
Copy link
Collaborator

miikka commented Mar 9, 2018

This is still an issue with Doo 0.1.8. There's an assertion that has helpful text, but it unhelpfully also prints a stacktrace. The stacktrace should be suspended, and in general, assertions shouldn't be used for validating the command-line arguments. Assertion failures should indicate a bug in the program and the user not knowing the right arguments is not a bug.

(assert (not (and (default? cli-alias) (not (contains? alias-map :default))))
"\n
To call lein doo without a js-env you need a :default :alias in
your project.clj and a default build. For example:
{:doo {:build {:source-paths [\"src\" \"test\"]}
:alias {:default [:firefox]}}}
then you can simply use
lein doo\n")

@bensu
Copy link
Owner

bensu commented Mar 12, 2018

That sounds like a sensible rule. figwheel has some good error reporting, maybe we should steal it.

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

4 participants