From 2584fbe8d2d63926dff5383a9b62f70e98efe16f Mon Sep 17 00:00:00 2001
From: Patrick Spek
Date: Sun, 30 Jul 2023 08:51:04 +0200
Subject: Add portage dir to tyilnet
---
playbooks.d/etc-portage/description.txt | 1 +
playbooks.d/etc-portage/playbook.bash | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
create mode 100644 playbooks.d/etc-portage/description.txt
create mode 100644 playbooks.d/etc-portage/playbook.bash
(limited to 'playbooks.d')
diff --git a/playbooks.d/etc-portage/description.txt b/playbooks.d/etc-portage/description.txt
new file mode 100644
index 0000000..8d90523
--- /dev/null
+++ b/playbooks.d/etc-portage/description.txt
@@ -0,0 +1 @@
+A symlinked directory to keep its content synced through Bashtard
diff --git a/playbooks.d/etc-portage/playbook.bash b/playbooks.d/etc-portage/playbook.bash
new file mode 100644
index 0000000..3140bb3
--- /dev/null
+++ b/playbooks.d/etc-portage/playbook.bash
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+
+# shellcheck disable=SC2034
+
+BASHTARD_PLAYBOOK_VARS[$BASHTARD_PLAYBOOK.path]="required"
+
+playbook_add() {
+ mkdir -pv -- "$(dirname "$(config "$BASHTARD_PLAYBOOK.path")")"
+ ln -sv -- "$(playbook_path "data")" "$(config "$BASHTARD_PLAYBOOK.path")"
+}
+
+playbook_sync() {
+ :;
+}
+
+playbook_del() {
+ rm -- "$(config "$BASHTARD_PLAYBOOK.path")"
+}
--
cgit v1.1