Fork me on GitHub
#boot
<
2016-08-01
>
flyboarder03:08:57

@jetzajac: I had a task like that in mind, I wrote boot-exec to ease writing shell commands with boot

pesterhazy07:08:36

@jetzajac: I could really use that as well for boot-react-native

pesterhazy07:08:29

@flyboarder: boot-exec looks neat! can it call processes in the background?

pesterhazy07:08:02

the other problem is that with npm it's not really feasible to re-install everything on every boot run, as it takes too long, so the npm directory cannot be a tmp-dir

flyboarder08:08:36

@pesterhazy: it is not smart enough to handle background procโ€™s and assumes you want to wait for execution, also with boot-exec you can pass a :directory this can be a cache directory created by the npm wrapper task, a similar thing is done with boot-bower

pesterhazy08:08:13

oh wow, I didn't know you could use boot's cache from boot modules

pesterhazy08:08:25

so many possibilities ๐Ÿ™‚

eggsyntax14:08:43

Hi y'all, I'm pretty much brand new to boot, long-time lein user. Is there a way to do what vinyasa does in lein, ie inject code into clojure.core so that it'll be loaded in every namespace? (eg requiring pprint) Vinyasa: https://github.com/zcaudate/vinyasa

eggsyntax14:08:49

(in the REPL, that is, not in production)

micha14:08:04

@eggsyntax: it couldn't be easier

micha14:08:15

(intern (the-ns 'clojure.core) 'foop 100)

micha14:08:28

you can put that in your profile.boot file

micha14:08:30

for instance

eggsyntax14:08:41

Ah, that is easy. Thanks!

micha14:08:01

all boot does is get you to the point where you can program in clojure

micha14:08:04

from there you can do anything

eggsyntax14:08:20

๐Ÿ‘ ๐Ÿ™‚

micha14:08:28

there is also a file that boot looks for, boot-shim.clj

micha14:08:37

in the ~/.boot directory and in the project dir

micha14:08:48

that will be evaluated in every pod

micha14:08:55

you can use that to modify clojure itself

micha14:08:06

or to add your "injections" etc

eggsyntax14:08:25

Cool, I'll look into that as well.

micha14:08:19

@eggsyntax: if you do boot -vb task task you can see the namespace boot generates

micha14:08:29

might help you see what's exactly going on

micha14:08:03

that generated namespace is the only magical part of the bootstrapping process

eggsyntax14:08:35

Excellent, thanks so much ๐Ÿ™‚

micha14:08:49

:+1: have fun!

alandipert16:08:18

iirc it's just a comment currently

bsima16:08:23

๐Ÿ‘Œ

spieden18:08:08

is there a way in boot to launch a REPL in the environment of the build itself?:

spieden18:08:20

e.g. to inspect settings, etc.

micha18:08:57

@spieden: not sure what you mean by the build itself?

spieden18:08:33

well, for example iโ€™m trying to debug "missing jar file or repo not found"

spieden18:08:52

if i could open an interactive session and evaluate (core/configure-repositories!) i could see what repos are ending up configured

micha18:08:03

boot repl gives you that

micha18:08:50

you could do boot -B repl to get a repl without the build.boot file being evaluated

micha18:08:02

if you suspect your build.boot is faulty

micha18:08:13

then you can do (load-file "build.boot") in the repl

spieden18:08:41

so the repl task is dual purpose โ€” for both project code and boot stuff

micha18:08:53

there is no separation

micha18:08:03

boot and project are the same

spieden18:08:09

thatโ€™s really cool

micha18:08:20

boot just provides some functions and whatnot that you can require and use

micha18:08:31

but your build.boot is just a clojure program

micha18:08:42

you can do everything you can do on the command line in the repl

micha18:08:58

well except for starting another repl lol

micha18:08:17

i'm not sure what (boot (repl)) would do when you're already in the repl

spieden18:08:35

so tasks are just fns with some extra metadata to enable cli invocation?

micha18:08:10

they're functions that are generated from the deftask macro, so they know how to accept command line arguments or repl arguments

micha18:08:20

but yes they're regular functions

micha18:08:36

there is also metadata, like you say, which helps boot find which tasks are available, for isntance

micha18:08:55

and also some things to help boot parse a command line with multiple tasks involved

micha18:08:52

also i just discoverd that you can do (boot (repl)) when you're already in a repl

micha18:08:08

it starts a nested one, apparently

bsima18:08:41

^^ composability FTW

spieden18:08:50

ok, thanks for the explainer

micha18:08:14

@spieden: the ins and outs of the command line stuff is here: https://github.com/boot-clj/boot/wiki/Task-Options-DSL

spieden18:08:02

iโ€™m still on lein but working with boot within cljsjs

spieden18:08:19

much easier to debug whatโ€™s going on