This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-02-12
Channels
- # announcements (7)
- # babashka (13)
- # beginners (14)
- # business (7)
- # clerk (4)
- # clj-kondo (21)
- # clojure (42)
- # clojure-denmark (5)
- # clojure-dev (16)
- # clojure-europe (27)
- # clojure-finland (1)
- # clojure-nl (1)
- # clojure-norway (36)
- # clojure-sweden (2)
- # clojure-uk (34)
- # clojurescript (29)
- # datomic (15)
- # emacs (1)
- # hyperfiddle (13)
- # jobs (11)
- # joyride (8)
- # malli (15)
- # missionary (10)
- # off-topic (5)
- # portal (6)
- # releases (3)
- # shadow-cljs (9)
- # spacemacs (27)
- # specter (2)
- # squint (12)
Hello i need some help with the strange code behaviour
(ns shell
(:require [babashka.process :as p]))
(comment
(p/shell "echo test")
)
i get this error:
java.io.IOException: CreateProcess error=2, file not found user c:\Users\Dzedas\source\repos\shelltest\src\shell.clj:1:1
im on windows , it works on @pez Mac.you can try (babashka.fs/which "echo")
- if it doesn't return an executable, then that's the answer
Indeed. We get nil
on Dzedas’ machine for that which
expression, and we get the expected path on my machine. However, echo Hello
works fine on the command prompt. Even for a Windows-y command like dir
we have this strange behaviour, with shell not working and nil
returned for (babashka.fs/which "dir")
.
if you want to call out to powershell, do something like:
(p/shell "pwsh -c 'echo dude'")
or whatever the syntax for that isHi, from Babashka script a.clj
I want to refer to another script b.clj
(e.g. (require 'b)
) - can anyone tell me how to do this? How can I specify the classpath for looking up other scripts? Do both scripts need to be in the same directory?
Would be great if anyone can point me to an example.
Add a bb.edn
file, with :paths ["."]
if the script is in the root directory, if not, add :paths ["src"]
or so
It worked, @U04V15CAJ thanks!