diff --git a/bash_aliases.sh b/bash_aliases.sh index 6f348c0..b0a8fbe 100644 --- a/bash_aliases.sh +++ b/bash_aliases.sh @@ -48,14 +48,13 @@ function copy_func() } function sync_git_only() -{ - ( cd "$( dirname "$(realpath -e "${BASH_SOURCE[0]}")" )" if git add . && ! git diff-index --cached --quiet HEAD; then git commit -am "Autocommitted updated scripts from $(hostname)" fi git pull --rebase git submodule update --init --recursive + ./install.sh if ! git --no-pager diff --exit-code origin/master master; then git --no-pager log --reverse origin/master..master if ! read -p "OK to push these changes? (Y/N) " -N 1 confirm; then diff --git a/install.sh b/install.sh index 6c7843d..8a55005 100755 --- a/install.sh +++ b/install.sh @@ -27,9 +27,13 @@ if [[ -z "$1" ]]; then chmod -R u=rwX,g=,o= "$dir" chmod 600 "$dir"/ssh/authorized_keys elif [[ "$1" == "link" ]]; then - ln --symbolic -T "$hostdir/$relpath" ~/"$relpath" + if [[ "$(readlink ~/"$relpath")" != "$hostdir/$relpath" ]]; then + ln --symbolic -v -T "$hostdir/$relpath" ~/"$relpath" + fi elif [[ "$1" == "mkdir" ]]; then - mkdir -p ~/"$relpath" + if [[ ! -d ~/"$relpath" ]]; then + mkdir -vp ~/"$relpath" + fi else echo "unknown command $1" fi