#!/bin/bash -eu

readonly SRC="https://github.com/rinatz/dotfiles/archive/master.tar.gz"
readonly DEST="${HOME}/.dotfiles"

function main() {
  mkdir -p "${DEST}"
  curl -fsSL "${SRC}" | tar zxv -C "${DEST}" --strip-components 1

  local dotfiles
  dotfiles=$(find "${DEST}" -name ".*" | grep -v windows)

  for dotfile in ${dotfiles[@]}; do
    [[ "${dotfile}" == "${DEST}" ]] && continue

    ln -svf "${dotfile}" "${HOME}"
  done
}

main "$@"

#!/bin/bash -eu

readonly SRC="https://github.com/rinatz/dotfiles/archive/master.tar.gz"
readonly DEST="/tmp/dotfiles"

function main() {
  mkdir -p "${DEST}"
  curl -fsSL "${SRC}" | tar zxv -C "${DEST}" --strip-components 1

  local dotfiles
  dotfiles=$(find "${DEST}" -name ".*")

  for dotfile in ${dotfiles[@]}; do
    [[ "${dotfile}" == "${DEST}" ]] && continue
    [[ "${dotfile}" == "${DEST}/.git" ]] && continue

    if [[ ! $(uname) =~ ^MINGW.*$ ]]; then
      [[ "${dotfile}" =~ ^.*\/windows\/.* ]] && continue
    fi

    \cp -rv "${dotfile}" "${HOME}"
  done

  rm -rf "${DEST}"
}

main "$@"

Copy files instead of symlinking
Copy files instead of symlinking
