Fork me on GitHub
#boot
<
2017-05-15
>
ag00:05:27

can someone help me with a task with an optional argument? For example if I have something like this:

(deftask foo
  []
  (case val
    "bar" (bar)
    "baz" (baz)
    (foo)))

ag00:05:45

how should the arguments for this task should look like?

ag00:05:58

so I can call it either boot foo or boot foo -val "bar"

richiardiandrea00:05:02

@ag you can put the arg in there anyways and if not passed it will be nil inside the task definition

ag00:05:28

yeah, I just realized that… /me being stupid

richiardiandrea00:05:59

lol ah ah no probs

minikomi04:05:46

I’m running a ring app under boot, and want to access the /resources dir for uploads.. when I use (io/resource "") it gives me back a cache directory used by boot.. (like #object[java.net.URL 0x7c46a8b7 "file:/Users/adm/.boot/cache/tmp/Users/adm/src/cmsproj/3ay/-7bl902/"] ) I’m wondering if I can “reset” the resource directory path somehow, or should I use another fn to get the upload directory?

minikomi04:05:37

(.getCanonicalPath ( ".")) is a better way to reference actual files/folders within a project?

kuzmin_m07:05:28

Hi! How I can run node.js cljs repl with boot? boot-cljs-repl work only with browsers. I need nrepl support too.

kuzmin_m07:05:24

Is anybody have boot task snippet for:

(require 'cljs.repl.node
         'cemerick.piggieback)
(cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env))
It create .cljs_node_repl folder. But with boot it must use tmp-dir.

Tim14:05:05

does anyone recall the technical reason we can’t set the :jvm-opts in boot the same way we do in project.clj in lein ?

pesterhazy14:05:55

boot uses only a single JVM process whereas lein spawns a second process

pesterhazy14:05:33

so once the Clojure code needed to parse build.boot is ready, it's too late to change JVM settings

lwhorton16:05:29

does boot offer some sort of copy operation? I have a weird case where I want to sift :move something into two directories, but invoking sift move twice doesnt seem to place the item into both paths (as expected)

lwhorton16:05:03

so before I go making a copy task, I wanted to make sure there’s not something simple I’m missing with the built-ins

flyboarder16:05:26

@lwhorton there are built-in functions for copy but not a specific task

flyboarder16:05:47

I believe there are community tasks for this

anmonteiro17:05:31

I wonder if there’s an uncovered edge case in boot show -u

anmonteiro17:05:19

My project depends on adzerk-oss/boot-cljs-repl "0.3.3", but when running boot show -u it lists version 0.3.2 as an available update

miikka17:05:32

anmonteiro: boot show -u shows outdated versions all the time. There's an issue: https://github.com/boot-clj/boot/issues/577

pandeiro17:05:03

Do any boot-http users have an opinion on this PR/issue: https://github.com/pandeiro/boot-http/issues/55

pandeiro17:05:36

Quick statement of problem: Jetty does not default to UTF-8, some JS libs are written with unicode chars, breakage ensues

pandeiro17:05:01

Solution offered: just inject UTF-8 charset into headers on everything boot-http serves

pandeiro17:05:52

My concern: What if the thing being developed is deployed w/o boot-http somewhere, and the default charset in the production CDN or whatever is not UTF-8?

richiardiandrea17:05:41

@pandeiro maybe boot-http can detect and emit a warning, plus expose an options for doing what you said above?

richiardiandrea17:05:02

I don't know how easy is to detect that actually..

pandeiro17:05:12

Yeah, that would be my question

pandeiro17:05:54

At the very least, if it does this, it should be documented somewhere probably

pandeiro17:05:14

Thanks @richiardiandrea - guess I will merge that, document, and wait to see if anyone has issues with it

pandeiro17:05:31

...and if so, I could add another option to turn it off

richiardiandrea17:05:57

yeah well, turn it off or make explicit that you need to control it

richiardiandrea17:05:31

given the above SO thing, I was even thinking if this should be a require parameter, no defaults 😄 maybe too extreme

pandeiro17:05:54

Hmm, yeah, I can see your point

pandeiro17:05:38

But given most web developers probably want the UTF-8 charset 99.9% of time... we might say it's a convention and try to serve that use-case

miikka17:05:09

If it was me, I'd be opinionated and add UTF-8 headers by default, and add a configuration option for changing/removing them.

richiardiandrea17:05:14

I think that is the plan?

miikka17:05:21

In Python-land, I've used the chardet library for guessing character sets of text files and it mostly works, but is very slow. I think it was something like hundreds of ms for megabyte of text on modern laptop.

miikka17:05:14

(and it's not because it's poor library, it just works hard to be as correct as it can :P)

pandeiro17:05:15

Yes @miikka good points; we'll do default + configuration option, that seems like the sweet spot IMO

pandeiro17:05:33

Thanks for the input