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