boot

:boot-clj: https://boot-clj.github.io/ — build tooling for Clojure. Dev chat in #boot-dev
Rex 2019-11-17T23:43:19.024800Z

Hey guys, I'm new here so please bear with me. I'm creating a boot script with the following content:

#!/usr/bin/boot

(defn -main
	[& args]
	(println "blah"))
but got this error whenever I try to run it
Boot failed to start:
java.lang.NullPointerException
        at boot.main$shebang_QMARK_.invokeStatic(main.clj:114)
        at boot.main$shebang_QMARK_.invoke(main.clj:110)
        at boot.main$_main.invokeStatic(main.clj:140)
        at boot.main$_main.invoke(main.clj:123)
        at clojure.lang.Var.invoke(Var.java:394)
        at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke(ClojureRuntimeShimImpl.java:154)
        at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke(ClojureRuntimeShimImpl.java:145)
        at boot.App.runBoot(App.java:407)
        at boot.App.main(App.java:500)
Can someone please tell me what I'm doing wrong with this? Also if I follow the instruction in https://github.com/boot-clj/boot/wiki/Scripts I still have the same issue.

2019-11-18T17:38:33.025200Z

Rex 2019-11-18T22:20:13.025600Z

I installed Boot via Homebrew, so boot actually lives in /home/linuxbrew/.linuxbrew/bin/boot

Rex 2019-11-18T22:21:00.025800Z

but that should be fine since /usr/bin/env boot finds the first boot executable in the PATH?

borkdude 2019-11-19T11:50:48.026Z

fwiw, this worked for me:

#!/usr/local/bin/boot

(defn -main
  [& args]
  (println "blah"))

Rex 2019-11-19T23:46:57.026200Z

maybe my boot executable is just in the wrong place

2019-11-20T16:39:56.027700Z

What does which boot say?

2019-11-20T16:41:30.027900Z

Because from the output it looks like boot ran.

Rex 2019-11-21T00:48:36.028100Z

/home/linuxbrew/.linuxbrew/bin/boot

Rex 2019-11-21T00:50:20.028300Z

I'm really new into this whole thing, and googling that error didn't give me any result at all

2019-11-21T15:34:30.028700Z

Uninstall boot and re-install it. Then make a new empty directory, cd into it, and run boot to see what happens.

2019-11-21T15:35:39.028900Z

I'm guessing that (System/getProperty "boot.app.path") is null here. https://github.com/boot-clj/boot/blob/master/boot/core/src/boot/main.clj#L113-L114

Rex 2019-11-21T22:58:20.029200Z

ok so I uninstalled linuxbrew 's boot

Rex 2019-11-21T22:58:34.029400Z

and downloaded the executable directly and put it on the PATH

Rex 2019-11-21T22:58:40.029600Z

and now it works perfectly fine

Rex 2019-11-21T22:58:43.029800Z

o.O

Rex 2019-11-21T23:01:43.030100Z

thanks for the suggestion tbl3rd 😄 I can start automating my stuff with clojure now to slowly convert people to clojurists 👀

2019-11-25T22:59:32.034700Z

Welcome to the party!