#buildinpublic

Опубликовано: 07 Август 2026
на канале: Max Weber
532
17

Short tutorial how to write a shell script with Clojure instead of Bash by using the awesome https://github.com/babashka/babashka project.

ffmpeg-small babashka script from the video:

#!/usr/bin/env bb

(require '[clojure.string :as str]
'[babashka.tasks :as tasks])

(def input-file-name
(first *command-line-args*))

(def output-file-name
(str/replace input-file-name
".mp4"
"_small.mp4"))

(def cmd
["ffmpeg"
"-i" input-file-name
output-file-name
]
)

(apply tasks/shell
cmd)