Use safer detection of process command
This commit is contained in:
parent
5ab8b3f975
commit
ccebfa630f
1 changed files with 99 additions and 99 deletions
|
|
@ -1142,11 +1142,11 @@ Use bb run --help to show this help output.
|
|||
|
||||
(defn binary-invoked-as-jar []
|
||||
(and (= "executable" (System/getProperty "org.graalvm.nativeimage.kind"))
|
||||
(let [bin (-> (java.lang.ProcessHandle/current)
|
||||
(when-let [bin (-> (java.lang.ProcessHandle/current)
|
||||
.info
|
||||
.command
|
||||
.get)
|
||||
fn (fs/file-name bin)]
|
||||
(.orElse nil))]
|
||||
(let [fn (fs/file-name bin)]
|
||||
(if (= "bb" fn)
|
||||
false
|
||||
(if (and (fs/windows?)
|
||||
|
|
@ -1155,7 +1155,7 @@ Use bb run --help to show this help output.
|
|||
(when (try (with-open [_ (java.util.zip.ZipFile. (fs/file bin))])
|
||||
true
|
||||
(catch Exception _ false))
|
||||
bin))))))
|
||||
bin)))))))
|
||||
|
||||
(defn resolve-symbolic-link [f]
|
||||
(if (and f (fs/exists? f))
|
||||
|
|
|
|||
Loading…
Reference in a new issue