summaryrefslogtreecommitdiff
path: root/.install
diff options
context:
space:
mode:
Diffstat (limited to '.install')
-rwxr-xr-x.install/editor32
-rwxr-xr-x.install/runall1
2 files changed, 33 insertions, 0 deletions
diff --git a/.install/editor b/.install/editor
new file mode 100755
index 0000000..bd9a8ab
--- /dev/null
+++ b/.install/editor
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+NVIM_DIR="${HOME}/.config/nvim"
+EMACS_DIR="${HOME}/.config/emacs"
+
+clone_repo() {
+ local repo_url="$1"
+ local target_dir="$2"
+
+ mkdir -p "$(dirname "$target_dir")"
+
+ if [[ -d "$target_dir" ]]; then
+ if [[ -d "$target_dir/.git" ]]; then
+ echo "Skipping $target_dir (already a git repo)."
+ return 0
+ fi
+
+ if [[ -n "$(ls -A "$target_dir")" ]]; then
+ echo "Refusing to clone into non-empty directory: $target_dir" >&2
+ return 1
+ fi
+ fi
+
+ echo "Cloning $repo_url into $target_dir"
+ git clone "$repo_url" "$target_dir"
+}
+
+clone_repo "https://github.com/QuixoticNapoleon/QuixoticNeovim" "$NVIM_DIR"
+clone_repo "https://github.com/QuixoticNapoleon/NapoleonMacs" "$EMACS_DIR"
+
+echo "Editor configs installed."
diff --git a/.install/runall b/.install/runall
index 4cdba8c..bbfe883 100755
--- a/.install/runall
+++ b/.install/runall
@@ -39,6 +39,7 @@ else
fi
"$SCRIPT_DIR/aetherfox"
+"$SCRIPT_DIR/editor"
if [[ "$install_ohmyzsh" -eq 1 ]]; then
if [[ -d "$HOME/.oh-my-zsh" ]]; then