Fork me on GitHub
#boot
<
2018-07-26
>
zalky15:07:21

Hi all, running into another issue. I have a boot task that downloads a js lib to the fileset, and then compiles it as a foreign lib. Here is a simplified version of the task:

(comp (download :url "package-url"
                :target "package.js")
      (watch)
      (reload)
      (sass :output-style :compressed)
      (cljs :optimizations :advanced
            :compiler-options
            {:foreign-libs [{:file "package.js"
                             :provides ["package"]}]})
      (sift)
      (target))
The issue I'm seeing is that it compiles great the first time, but when the code reloads, it throws a java.io.FileNotFoundException for package.js. Have I structured the task correctly? I would have though the download puts the file in the fileset once, and then it's there for every iteration of watch.

borkdude16:07:45

How does this work again?

(deftask foo
    [r records int "number of records"]
    *opts*)

(boot.core/boot "foo" "-r" "100")
;;=> No such task (100)

borkdude16:07:19

And (foo "-r" "100") works, but returns {:records 1} 🤔

borkdude16:07:59

ok, I should probably insert VAL

zalky16:07:00

@borkdude I believe if you want to pass in a value along with -r you need an extra arg in the task def. See here, https://github.com/boot-clj/boot/wiki/Task-Options-DSL#anatomy, the 3. Optarg. It indicates that option is not just a flag.