This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-09-21
Channels
- # admin-announcements (17)
- # aws (19)
- # beginners (28)
- # boot (103)
- # cider (5)
- # clojure (183)
- # clojure-art (46)
- # clojure-russia (25)
- # clojure-sg (2)
- # clojure-uk (1)
- # clojurescript (342)
- # clojurex (3)
- # core-matrix (1)
- # cursive (1)
- # datascript (2)
- # devcards (77)
- # devops (15)
- # emacs (4)
- # funcool (8)
- # hoplon (15)
- # immutant (47)
- # jobs (1)
- # ldnclj (10)
- # lein-figwheel (4)
- # off-topic (2)
- # om (23)
- # onyx (10)
- # re-frame (1)
- # reagent (23)
- # yada (7)
Let’s say that, in a Boot task, I want to modify a resource on my classpath for a downstream task, and keep it at the same location. Is it bad to directly the modify the resource directly using
?
@cigitia: it's better to copy and rm, https://github.com/adzerk-oss/boot-template is an example
@alandipert: I see; thanks.
@alandipert: If it’s a specific resource that I want to modify, is there a better way of getting its File object from the input fileset other than using
?
@cigitia: check out boot.core/tmp-file
it sounds like the private copy
function in boot-template may do close to what you want
it makes use of tmp-file
@alandipert: The thing about that, though, is that tmp-file
requires that I’ve obtained a temp-file object from the fileset already.
My problem is that I need to retrieve a specific input file at a specific path from the fileset.
i see
for the finding part, i think you want boot.core/by-name
err, 1 sec
i find better example
@alandipert: Thanks!
yeah, so to get a list of files from the fileset, you use the 'query' api - https://github.com/boot-clj/boot/wiki/Filesets#fileset-queries
by-name is expecting the objects returned by a query
e.g. (by-name ["foo.bar"] (input-files fs))
in the boot-template thing i do my own by-name on https://github.com/adzerk-oss/boot-template/blob/master/src/adzerk/boot_template.clj#L40, can't remember why
that would be excellent, thanks in advance!
no prob
Is there a way to create a package on cljsjs with a optional dependency but participate on the dependency graph? Eg. vega optionally depends on d3-cloud (only for word clouds). But when it does vega should be loaded before d3-cloud.
@alandipert: Is there a particular reason why, given a resource-file-path
,
(->> fileset boot/input-files (filter (comp #{resource-file-path} :path)))
…would successfully get the resource file that I want, at the same time that…
(->> fileset boot/input-files (boot/by-name [resource-file-path]))
…gives an empty collection? I’m checking the source at https://github.com/boot-clj/boot/blob/master/boot/core/src/boot/core.clj#L877, and it seems like it should have worked.
@cigitia: you can also easily access files by their full path doing something like this (get-in fileset [:tree "public/index.html"])
I'm not 100% sure if this is a ”public“ api feature, maybe @micha can comment on that.
they're set to be read-only via file permissions, but you could get around that i'm sure
the way you can replace a file in the fileset with another file is to create a new file in a temp dir such that the new file has the same relative path as the one you want to replace, and then add the temp dir to the fileset.
I found this https://github.com/Deraen/saapas but it fails on first task for me
@nha: What's the problem? It should work and it should be okay to use as a template
@juhoteperi: ah hello Well I just opened an issue if you want to look at it https://github.com/Deraen/saapas/issues/6
@nha: Aha, that's caused by old Boot binary
boot -u
only updates Boot library, you'll have to download new binary yourself
Either dowload http://boot.sh/exe or upgrade boot-clj package with brew
I think brew update && brew upgrade boot-clj
should work also
update updates the package repository and upgrade upgrades the package
Latest binary is 2.3 and latest in Brew is 2.2
only fixes a bug where something like BOOT_JVM_OPTIONS='-Dfoo="something with quotes"' boot ...
@juhoteperi: works perfectly
ok so if I want a dev/user.clj
repl available, I should add (set-env! :source-paths #{"src" "dev"}) to my task ?
so I get that I have to do (1) boot dev (2) cider-connect (3) (start-repl) to get a cljs-repl
What are the advantages of doing that ? It means I never have to relaunch a repl ? Or is there a shorter way to get a cljs repl ?
if you want to automate things you can: boot tasks compose with each other and with your own tasks
well I found that here : https://github.com/boot-clj/boot/wiki/Cider-REPL
oh right, yeah those are dynamic vars that the repl task will use to load dependencies that are specific to repl stuff
@raywillig: i can't reproduce that
@raywillig: oh wait, i can reproduce
@raywillig: I get that when running boot in a directory where there is no boot file ?
Created /home/micha/git/boot-clj/boot/boot/worker/target/worker-2.3.1.jar
Sending boot/worker/2.3.1/worker-2.3.1.pom (6k)to
Sending boot/worker/2.3.1/worker-2.3.1.jar (3276k)to
Retrieving boot/worker/maven-metadata.xml (2k)from
Checksum validation failed, expected a021f08e23e63bc818ba7ce17ac8af762c642efc but is 3f636e7ba8fd408dff585517a1407f01d227663c
Retrieving boot/worker/maven-metadata.xml (2k)from
Could not transfer metadata boot:worker/maven-metadata.xml from/to clojars ( ): Checksum validation failed, expected a021f08e23e63bc818ba7ce17ac8af762c642efc but is 3f636e7ba8fd408dff585517a1407f01d227663c
Failed to retrieve remote metadata boot:worker/maven-metadata.xml: Could not transfer metadata boot:worker/maven-metadata.xml from/to clojars ( ): Checksum validation failed, expected a021f08e23e63bc818ba7ce17ac8af762c642efc but is 3f636e7ba8fd408dff585517a1407f01d227663c
Makefile:94: recipe for target '.deployed' failed
make: *** [.deployed] Error 1
looks like a case of mangled clojars metadata https://github.com/ato/clojars-web/issues/369
@micha: I can fix that checksum issue manually, but not right now :( Can you file an issue at ato/clojars and I can fix it first thing in the AM