Compare commits

..

No commits in common. "d8ef23aa61da29297c7a8b46e8fb915eb7b0cc6f" and "8edc20281527e91d7c020b80f811fbd19cbbbbdd" have entirely different histories.

1 changed files with 2 additions and 9 deletions

11
copy.sh
View File

@ -38,16 +38,9 @@ echo "$dotfiles" | while read -r dotfile; do
done done
function add-export { function add-export {
local final="$1\"$2\"" if ! grep "$1" "$HOME/.zsh_local" &> /dev/null; then
if grep "$final" "$HOME/.zsh_local" &> /dev/null; then echo "$1\"$2\"" >> "$HOME/.zsh_local"
return
fi fi
if grep "$1" "$HOME/.zsh_local" &> /dev/null; then
echo "Replacing '$(grep "$1" "$HOME/.zsh_local")' with '$final'"
local escaped="$(echo "$1" | sed 's@/@\\/@g')"
sed -i "/$escaped/d" "$HOME/.zsh_local"
fi
echo "$final" >> "$HOME/.zsh_local"
} }
add-export "export DOT_DIR=" "$SCRIPT_DIR" add-export "export DOT_DIR=" "$SCRIPT_DIR"