Dotfiles/site-modules/core/files/bin/dotfiles
Ade Attwood d23aa40709 feat(configz): move the dotfiles script to only use configz
Soon we will probably be able to remove all the puppet stuff. I don't even have
it installed on new machines anymore.

You can now list and apply single configz to target updates or install separate
parts on different machines.
2024-11-28 17:51:47 +00:00

53 lines
1.1 KiB
Bash
Executable file

#!/usr/bin/env bash
#
# Cli app for managing files with configz
# see https://github.com/adeattwood/dotfiles
# see https://github.com/adeattwood/configz
#
# Author: Ade Attwood <code@adeattwood.co.uk>
# Version: 0.0.2
# Updated: 2018-07-16
#
SCRIPT="$(realpath "$(readlink -f "$0")")";
DOTFILES_DIR=${SCRIPT%%site-modules/core/files/bin/dotfiles*}
MODULES="$(ls -1 "$DOTFILES_DIR"/modules)"
MODULES="${MODULES//.lua/}"
case $1 in
apply)
shift
cd "$DOTFILES_DIR"
for module in $@; do
RUST_LOG=info configz --module "modules.$module";
done
exit 0;
;;
list)
echo "$MODULES" | column
exit 0;
;;
esac
cat << HELP
____ __ _____ __
/ __ \____ / /_/ __(_) /__ _____
/ / / / __ \/ __/ /_/ / / _ \/ ___/
/ /_/ / /_/ / /_/ __/ / / __(__ )
/_____/\____/\__/_/ /_/_/\___/____/
Usage: dotfiles <command>
Author: Ade Attwood <code@adeattwood.co.uk>
Commands:
list List all of the available configz modules
apply Apply a configz module
Examples:
Apply the zsh configz module
$ dotfiles apply zsh
HELP