Use apt instead of gdebi to install local deb file
[babashka-scripts.git] / install-deb.clj
CommitLineData
fbc08850
JN
1#! /usr/bin/env bb
2
3; Install a deb package from URL
4
76cc62f0
JN
5(require '[clojure.java.io :as io]
6 '[lib :refer [download-binary run-cmd unixify]])
fbc08850 7
76cc62f0
JN
8(defn- install-deb
9 [url]
96c05311
JN
10 (println "Downloading deb package...")
11 (download-binary url "package.deb")
12 (println "Installing...")
13 (println (run-cmd ["sudo" "apt" "install" "./package.deb"]))
14 (println "Cleaning up..")
15 (io/delete-file "package.deb")
16 (println "Done."))
76cc62f0
JN
17
18(unixify install-deb)