feat: Adds repos script to clone a few repositories on new installation / machine.

This commit is contained in:
2025-12-18 10:40:08 -05:00
parent e052f0c394
commit df876d2cac
2 changed files with 57 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ A list of in-progress and completed todo's.
- [ ] Need to ensure ssh keys are setup before private submodules are loaded / installed,
so I need to make sure that Yubikey setup runs early and works for ssh authentication.
- [ ] Setup a new machine / virtual machine to test, as it's hard to test the scripts once a machine is setup.
- [ ] Need to add `repos` script when bootstrapping.
### Keyboard / kanata

56
repos Executable file
View File

@@ -0,0 +1,56 @@
#!/usr/bin/env bash
set -e
set -o nounset
set -o pipefail
DEST="$HOME/dev"
dry_run_flag="0"
log() {
if [[ $dry_run_flag == "1" ]]; then
echo "[DRY RUN]: $*"
else
echo "$*"
fi
}
clone() {
local src=${1:-""}
local dest=${2:-$DEST}
log "Cloning '$src' in '$dest'"
if [[ $dry_run_flag == "0" ]]; then
pushd "$dest" || exit 1 &>/dev/null
(
git clone "$src"
)
popd &>/dev/null
fi
}
install-psychrometrics() {
log "Installing psychrometrics cli."
if [[ $dry_run_flag == "0" ]]; then
local src="$DEST/psychrometrics-cli"
pushd "$src" || exit 1 &>/dev/null
(
./install-linux.sh
)
popd &>/dev/null
rm -rf "$src"
fi
}
##### MAIN #####
while [[ $# -gt 0 ]]; do
if [[ $1 =~ ^-d ]] || [[ $1 =~ ^--dry ]]; then
dry_run_flag="1"
fi
shift
done
mkdir -p "$DEST/sites" &>/dev/null
clone "git@github.com:m-housh/mhoush.com.git" "$DEST/sites"
clone "git@github.com:swift-psychrometrics/psychrometrics-cli.git" && install-psychrometrics