Adds import script and uses a shared list of the files to copy.
This commit is contained in:
18
files.sh
Normal file
18
files.sh
Normal 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
13
import.sh
Executable 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
|
||||||
|
|
||||||
20
install.sh
20
install.sh
@@ -1,7 +1,13 @@
|
|||||||
#! /usr/bin/env sh
|
#!/usr/bin/env bash
|
||||||
cp .gitconfig .gitignore .gitignore_global ../
|
|
||||||
cp .hgignore_global ../
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
cp .profile ../
|
source "$SCRIPT_DIR/files.sh"
|
||||||
cp .bash_logout .bashrc ../
|
|
||||||
cp -r .zsh_functions .zprofile .zshenv .zshrc ../
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
cp -r .rc.d ../
|
|
||||||
|
for file in "${FILES[@]}"; do
|
||||||
|
if [ -e "./$file" ] || [ -L "./$file" ]; then
|
||||||
|
cp -r "./$file" ../
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user