Utility for creating self-removing tasks in Babashka's bb.edn. It was primarily
designed to work with kit-generator to add one-off tasks that the user will
run after installing a kit module and that will self-destruct.
Add to your bb.edn:
{:deps {bilus/bb-oneshot {:mvn/version "0.1.0-SNAPSHOT"}}
:tasks {:requires ([bilus.bb-oneshot :as oneshot])
my-task {:doc "Runs once then removes itself"
:task (do
(println "Doing something...")
(oneshot/remove-task! 'my-task))}}}After the task is run via bb my-task and succeeds, it will remove itself.
Copyright © 2025 Marcin Bilski
Distributed under the Eclipse Public License version 1.0.