Simplifies install and import scripts.

This commit is contained in:
2026-09-03 16:00:03 -07:00
parent 9f27d8a2c4
commit 56aca8a094
8 changed files with 213 additions and 72 deletions

View File

@@ -1,13 +1,24 @@
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/files.sh"
source "$SCRIPT_DIR/install_files"
cd "$SCRIPT_DIR" || exit 1
for file in "${FILES[@]}"; do
# Copy files and directories
for file in "${INSTALL_FILES[@]}"; do
if [ -e "./$file" ] || [ -L "./$file" ]; then
cp -r "./$file" ../
fi
done
# Ensure ~/.bashrc and ~/.zshrc exist and source ~/.init_profile
SOURCE_LINE='[ -f "$HOME/.init_profile" ] && . "$HOME/.init_profile"'
for rc in "$HOME/.bashrc" "$HOME/.zshrc"; do
touch "$rc"
if ! grep -qF "$SOURCE_LINE" "$rc"; then
printf "\n# Initialize profile environment\n%s\n" "$SOURCE_LINE" >> "$rc"
fi
done