Add utils and shell aliases
[babashka-scripts.git] / install-deb.clj
... / ...
CommitLineData
1#! /usr/bin/env bb
2
3; Install a deb package from URL
4
5(require '[clojure.java.io :as io] '[lib :refer [download-binary run-cmd]])
6
7(when (= *file* (System/getProperty "babashka.file"))
8 (let [url (first *command-line-args*)]
9 (println "Downloading deb package...")
10 (download-binary url "package.deb")
11 (println "Installing...")
12 (run-cmd ["sudo" "gdebi" "--non-interactive" "package.deb"])
13 (println "Cleaning up..")
14 (io/delete-file "package.deb")
15 (println "Done.")))