aboutsummaryrefslogtreecommitdiff
path: root/lib/subcommands/init.bash
diff options
context:
space:
mode:
Diffstat (limited to 'lib/subcommands/init.bash')
-rw-r--r--lib/subcommands/init.bash14
1 files changed, 3 insertions, 11 deletions
diff --git a/lib/subcommands/init.bash b/lib/subcommands/init.bash
index 46497f5..824956e 100644
--- a/lib/subcommands/init.bash
+++ b/lib/subcommands/init.bash
@@ -1,6 +1,6 @@
#!/usr/bin/env bash
-# SPDX-FileCopyrightText: 2022 Patrick Spek <p.spek@tyil.nl>
+# SPDX-FileCopyrightText: 2023 Patrick Spek <p.spek@tyil.nl>
#
# SPDX-License-Identifier: AGPL-3.0-or-later
@@ -23,6 +23,7 @@ init_local()
local dirs=(
"$BASHTARD_ETCDIR"
"$BASHTARD_ETCDIR/conf.d"
+ "$BASHTARD_ETCDIR/data.d"
"$BASHTARD_ETCDIR/hosts.d"
"$BASHTARD_ETCDIR/os.d"
"$BASHTARD_ETCDIR/playbooks.d"
@@ -35,7 +36,6 @@ init_local()
"$BASHTARD_ETCDIR/secrets"
"$BASHTARD_ETCDIR/hosts.d/${BASHTARD_PLATFORM[fqdn]}"
"$BASHTARD_ETCDIR/os.d/${BASHTARD_PLATFORM[key]}"
- "$BASHTARD_ETCDIR/playbooks.d/remotes"
)
for dir in "${dirs[@]}"
@@ -62,7 +62,7 @@ init_remote()
local remote="$1" ; shift
notice "init" "Cloning $remote to $BASHTARD_ETCDIR"
- git clone "$remote" "$BASHTARD_ETCDIR"
+ git clone --recurse-submodules "$remote" "$BASHTARD_ETCDIR"
local files=(
"$BASHTARD_ETCDIR/hosts.d/${BASHTARD_PLATFORM[fqdn]}"
@@ -77,12 +77,4 @@ init_remote()
notice "bashtard/init" "Creating $file"
touch -- "$file"
done
-
- while read -r playbook url _
- do
- notice "bashtard/init" "Cloning $playbook from $url"
- git clone "$url" "$BASHTARD_ETCDIR/playbooks.d/$playbook"
-
- # TODO: Clone appropriate branch
- done < "$BASHTARD_ETCDIR/playbooks.d/remotes"
}