This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-04-16
Channels
- # beginners (144)
- # boot (40)
- # cljsjs (1)
- # cljsrn (30)
- # clojure (190)
- # clojure-india (1)
- # clojure-poland (7)
- # clojure-russia (13)
- # clojure-spec (2)
- # clojurescript (2)
- # component (23)
- # css (6)
- # emacs (3)
- # events (5)
- # garden (4)
- # hoplon (2)
- # jobs-discuss (2)
- # klipse (1)
- # lein-figwheel (1)
- # off-topic (36)
- # re-frame (28)
- # reagent (2)
- # ring (7)
- # ring-swagger (2)
- # rum (3)
- # test-check (4)
- # untangled (4)
i’m having no luck with boot-new. i do boot -d boot/new new -t template -n tmp.foobar
, then cd tmp.foobar; boot build
installs it locally. then in a separate directory: boot -d boot/new new -t tmp.foobar -n foobar-test
, which gives “Failed to collect dependencies:… tmp.foobar:lein-template:…”
for discussion, before i spend time on a PR: boot-new should use namespaced syms for template name. iow, instead of -t foo-app
, we would do -t foo.bar/app
. this would support multiple templates in a single project.
the problem with the current impl if i understand it is that the project name and the template name must be the same. @seancorfield
@mobileink the default template project will produce a snapshot artifact. You'll need to tell boot-new to search for snapshots (`-S` I think -- check the docs).
Or you could change the template project version to non-snapshot before you install it.
but that's a separate issue from supporting multiple template in one boot-template lib, no? i don't how to do it currently.
also if you're open to adding some docs on howto develop a template lib i'll give it a shot.
You shouldn't use (System/exit 0)
when there's a failure. I'd prefer that your PR just added another (println (format ...))
to the existing println
calls in that exit-error
call.
Printing the actual exception is important.
Certainly happy to add more to the readme, so that's all good.
honest q: why not System/exit? my thinking is this: we caught the problem, we know exactly what it is, and we can tell the user exactly the problem. what is the point of a stack trace?
or to put it differently: it's not really an exception if it's something you have foreseen. Exceptions (imho) are for unexpected stuff.
stack traces are alienating in my view. in this case, if boot-new had simply told me it could not find [foo.bar"RELEASE'] i would have know immediately what the pronlem is. the stack trace was actually anti-helpful.
that's one thing. a separate thing is that boot-new throws only the last exception, when in fact there are two. so the msg is "i could not find the leinengen template", which is just wrong. i don't even care about leinengen, why is boot-new bothering?
so: an enhancement i would like to see is: assume boot. if you want a leinengen template, you must say so. when i'm using a boot template, i do not want to waste time searching for lein stuff.
fwiw i hope i don't sound too blunt, i'm grateful for your work. just trying to not waste time.
or to put it in a more poetic, Rumsfeldian mode: exceptions are for unknown unknows. Known unknowns should never throw exceptions. heh. http://www.slate.com/articles/news_and_politics/low_concept/2003/04/the_poetry_of_dh_rumsfeld.html
I meant specifically if you have an error, do not exit with a ZERO status.
Also, System/exit short-circuits Boot's error handling which might affect a build pipeline. You just shouldn't use it in a Boot task.
That's why there's exit-error
If you change your PR to just add an additional println
with your improved error message using format
, I'll merge it in.
I'm on my phone and that explanation is more than I'm willing to type.
I haven't actually gotten out of bed yet. Just responding as a courtesy.
will do, don't wanna argue. but i'm genuinely puzzled as to why System/exit is a bad idea.
Because it just stops the jvm right there and then. Tasks lose control.
why is that bad? serious question. i have a pipeline and a task fails. why not come to a screeching halt -so long as you have a good error msg.
Not typing an answer on my phone. Just accept it's the wrong thing to do.
heh, won't ask you to phone it, but i'm afraid i'm the kind of annoying guy who cannot "just accept". but this is a larger issue maybe somebody else will chime in and pull the worms out of my head. i will accept whatever you want for boot-new, however. i'll revise later today.
I'm up and about now. But still on my phone (out getting brunch). Will look for an updated PR sometime, thanks.
Btw, from the Boot source (re exit): https://github.com/boot-clj/boot/blob/f66aaf387740dc5968bde3f74a8761da154cab13/boot/pod/src/boot/util.clj#L279 @mobileink
is there a way to only get files/namespaces from certain input dirs, in my case the "source-paths"?