Fork me on GitHub
#babashka
<
2021-11-28
>
Benjamin11:11:12

How do I check the os? System/getProperty doesn't exist right? -nvm it does

borkdude11:11:37

It does. I usually do:

(def windows? (str/starts-with? (System/getProperty "os.name")
                                "Windows"))

catjam 1
borkdude11:11:59

We should probably have a built-in function for this somewhere, but where...

Benjamin11:11:45

babashka.core

borkdude11:11:51

babashka.core/windows?

borkdude11:11:55

yeah, I was thinking the same :)

thompen11:11:58

Is the :paths parameter supposed in a tasks file (bb.end) supposed to work exactly the same as the --classpath parameter? I tried a simple example like in the docs. The namespace didn't get picked up when defined as :paths ["script"], but did work when I called the task using: bb --classpath script run task I was running both command lines from the directory containing the bb.edn file and the script directory as an immediate sub-directory.

borkdude11:11:53

yes, this should work

borkdude11:11:08

the :paths option is top level, not under :tasks

thompen11:11:21

hmm is there a method that prints the classpath I can use to debug?

borkdude11:11:53

yes, you can use (babashka.classpass/get-classpath)

thompen12:11:51

cool.. I think the problem is that I have a BABASHKA_CLASSPATH defined and it's not appending/replacing it... is that the expected behavior?

borkdude12:11:00

yes, babashka classpath overrides, this is intended

thompen12:11:40

ok thanks. Another unrelated question, is there a native way to iterate, query, kill processes without resorting to ps, kill , etc ?

borkdude12:11:48

there is not a nice Clojure-idiomatic api for this in bb (yet)

p-himik15:11:39

That gives me an idea that you, perhaps, have already considered - creating a wrapper around clojure that would simply make some bits of it fast. Just so that users wouldn't have to think about what to call for which task.

borkdude15:11:41

@U2FRKM4TW yeah, eventually some of this may be used in bb itself, but the trade-off here is binary size for example. clojure is a wrapper around deps.clj and deps.clj still uses a regular JVM

borkdude15:11:16

I'm not yet sure what the implications of this will be, but we're releasing the low level bits first and then we'll see what happens next

p-himik15:11:09

Yeah, makes sense. Thanks!

Benjamin17:11:54

bb.edn

{:tasks ion-push
 (clojure
  {:env (let [{:keys [access-key-id secret]} ...]
          {"AWS_ACCESS_KEY_ID" access-key-id
           "AWS_SECRET_ACCESS_KEY" secret})}
  "-A:ion-dev"
  (prn-str {:op :push}))}
does this env part work like that?

borkdude17:11:10

@benjamin.schwerdtner I recommend using :extra-env but yes

partywombat 1
borkdude22:11:53

Windows users! On Windows (shell "yarn") didn't work, because on Windows you have to be explicit about the extension: (shell "yarn.cmd") if it's not an .exe extension. This is now improved on master. The issue: https://github.com/babashka/babashka/issues/1078 This is a Windows build for testing. Please give it a go. I hope I didn't break anything. https://ci.appveyor.com/api/buildjobs/4wohqob8t5mkruvw/artifacts/babashka-0.6.6-SNAPSHOT-windows-amd64.zip