]> njoseph.me Git - babashka-scripts.git/commitdiff
self-updater: Add missing when function
authorJoseph Nuthalapati <njoseph@riseup.net>
Fri, 12 Feb 2021 08:38:18 +0000 (14:08 +0530)
committerJoseph Nuthalapati <njoseph@riseup.net>
Fri, 12 Feb 2021 08:38:18 +0000 (14:08 +0530)
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
update-babashka.clj

index 41aa569410b8d9e5cc240c41f08d62908cea7ea8..1681e4db7f712ec31436cd86e720005ebeb501af 100755 (executable)
     (println (str "Latest version is " version))
     (download-binary url output)))
 
-(= *file* (System/getProperty "babashka.file")
-   (let [architecture "linux-static-amd64"  ;; TODO support multiple architectures
-         zip-file "babashka.zip"
-         destination (expand-home "~/bin/bb")
-         version (babashka-latest-version)]
-     (check-latest version)
-     (download-latest version architecture zip-file)
-     (extract-file-from-zip zip-file "bb" destination)
-     (fs/set-posix-file-permissions destination "rwxr-xr-x")
-     (io/delete-file zip-file)))
+(when (= *file* (System/getProperty "babashka.file"))
+  (let [architecture "linux-static-amd64"  ;; TODO support multiple architectures
+        zip-file "babashka.zip"
+        destination (expand-home "~/bin/bb")
+        version (babashka-latest-version)]
+    (check-latest version)
+    (download-latest version architecture zip-file)
+    (extract-file-from-zip zip-file "bb" destination)
+    (fs/set-posix-file-permissions destination "rwxr-xr-x")
+    (io/delete-file zip-file)))