Updates reference config with a bunch of os and shell safety. #1

Merged
maj merged 6 commits from machines/spider into main 2026-09-04 00:19:08 +00:00
3 changed files with 44 additions and 7 deletions
Showing only changes of commit c4b1af44b9 - Show all commits

18
files.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
FILES=(
".bash_logout"
".bashrc"
".config"
".gitconfig"
".gitignore"
".gitignore_global"
".hgignore_global"
".profile"
".rc.d"
".yarnrc"
".zprofile"
".zshenv"
".zsh_functions"
".zshrc"
)

13
import.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/files.sh"
cd "$SCRIPT_DIR" || exit 1
for file in "${FILES[@]}"; do
if [ -e "../$file" ] || [ -L "../$file" ]; then
cp -r "../$file" ./
fi
done

View File

@@ -1,7 +1,13 @@
#! /usr/bin/env sh
cp .gitconfig .gitignore .gitignore_global ../
cp .hgignore_global ../
cp .profile ../
cp .bash_logout .bashrc ../
cp -r .zsh_functions .zprofile .zshenv .zshrc ../
cp -r .rc.d ../
#!/usr/bin/env bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/files.sh"
cd "$SCRIPT_DIR" || exit 1
for file in "${FILES[@]}"; do
if [ -e "./$file" ] || [ -L "./$file" ]; then
cp -r "./$file" ../
fi
done