;; TODO Use festival-tts or say depending on OS
-(defn run-cmd
- [command]
- (->> command
- p/process
- :out
- slurp))
-
(let [book-file (first *command-line-args*)
title (first (split book-file #"\."))
txtz-file (str title ".txtz")
(println "Creating mp3 file...")
(run-cmd ["ffmpeg" "-i" aiff-file mp3-file])
(println "Cleaning up...")
- (run! #(io/delete-file %) [txtz-file txt-file aiff-file])
+ (run! io/delete-file [txtz-file txt-file aiff-file])
(println (str "Done! Check out " mp3-file)))
--- /dev/null
+#! /usr/bin/env bb
+
+; Install a deb package from URL
+
+(require '[babashka.process :as p]
+ '[clojure.java.io :as io])
+
+(when (= *file* (System/getProperty "babashka.file"))
+ (let [url (first *command-line-args*)]
+ (println "Downloading deb package...")
+ (download-binary url "package.deb")
+ (println "Installing...")
+ (run-cmd ["sudo" "gdebi" "--non-interactive" "package.deb"])
+ (println "Cleaning up..")
+ (io/delete-file "package.deb")
+ (println "Done.")))
(import '[java.nio.file Files FileSystems CopyOption StandardCopyOption])
-(require '[org.httpkit.client :as http])
+(require '[babashka.process :as p] '[org.httpkit.client :as http])
+
+(defn run-cmd
+ [command]
+ (->> command
+ p/process
+ :out
+ slurp))
(defn extract-file-from-zip
[zip-file-name source destination]