File tree Expand file tree Collapse file tree
resources/META-INF/native-image/babashka/process Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4545 java -version
4646 bb --version
4747
48- - name : 🔧 Install bb from dev build (until next release)
49- shell : bash
50- run : |
51- curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
52- chmod +x ./install
53- ./install --dev-build --dir /tmp
54- cp /tmp/bb "$(which bb)"
55-
5648 - name : Run bb tests
5749 run : |
5850 bb test:bb
Original file line number Diff line number Diff line change 11{:deps {babashka/fs {:mvn/version " 0.4.18" }}
2- :paths [" src" " resources" ]
32 :aliases {:test {:extra-paths [" test" ]
43 :extra-deps {io.github.cognitect-labs/test-runner {:git/tag " v0.5.1" :git/sha " dfb30dd" }}
54 :main-opts [" -m" " cognitect.test-runner" ]}
Original file line number Diff line number Diff line change 77 :url " https://www.eclipse.org/legal/epl-1.0/" }
88 :dependencies [[org.clojure/clojure " 1.9.0" ]
99 [babashka/fs " 0.4.18" ]]
10- :source-paths [" src" " resources" ]
1110 :deploy-repositories [[" clojars" {:url " https://clojars.org/repo"
1211 :username :env/clojars_user
1312 :password :env/clojars_pass
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 604604 :err :string } opts)]
605605 @(process* {:cmd cmd :opts opts :prev prev})))
606606
607- (def ^:private exec-meth
608- (delay (try (.getMethod (Class/forName " org.graalvm.nativeimage.ProcessProperties" ) " exec"
609- (into-array [java.nio.file.Path (Class/forName " [Ljava.lang.String;" ) java.util.Map]))
610- (catch Exception _ nil ))))
607+ (def ^:private has-exec?
608+ (boolean (try (.getMethod ^Class
609+ (resolve 'org.graalvm.nativeimage.ProcessProperties) " exec"
610+ (into-array [java.nio.file.Path (Class/forName " [Ljava.lang.String;" ) java.util.Map]))
611+ (catch Exception _ false ))))
612+
613+ (defmacro ^:no-doc
614+ if-has-exec [then else]
615+ (if has-exec?
616+ then else))
611617
612618(defn exec
613619 " Replaces the current process image with the process image specified
643649 ^java.util.Map env (into (or (as-string-map env)
644650 (into {} (System/getenv )))
645651 (as-string-map extra-env))]
646- (if-let [^java.lang.reflect.Method meth @exec-meth]
647- ( .invoke meth nil ( into-array Object [ (fs/path program)
648- (into-array String args)
649- env]) )
652+ (if-has-exec
653+ ( org.graalvm.nativeimage.ProcessProperties/exec (fs/path program)
654+ (into-array String args)
655+ env)
650656 (throw (ex-info " exec is not supported in non-GraalVM environments" {:cmd cmd}))))))
651657
652658(def ^:private default-shell-opts
You can’t perform that action at this time.
0 commit comments