- continue # already simlinked
- fi
- if [ -d "${DOTFILES_SRC}/${FILE}" ] && [ -d "${TARGET}/${FILE}" ] && \
- [ "${FORCE}" != 'yes' ]; then
- echo "use --force to override the existing directory: ${TARGET}/${FILE}"
- continue # allow unlinked directories
- fi
- if [ -e "$TARGET/${FILE}" ] && [ "${FORCE}" = 'no' ]; then
- echo "use --force to override the existing target: ${TARGET}/${FILE}"
- continue # target already exists
+ if [ "${FORCE_LINK}" = 'no' ]; then
+ # don't prompt about --force-link, because this will happen a lot
+ continue # already simlinked
+ elif [ ! -h "${TARGET}/${FILE}" ]; then
+ # target file/dir underneath an already symlinked dir
+ continue
+ else
+ # don't backup links that already point to the right place
+ BACKUP='no'
+ fi
+ else
+ if [ -d "${DOTFILES_SRC}/${FILE}" ] && [ -d "${TARGET}/${FILE}" ] && \
+ [ "${FORCE_DIR}" = 'no' ]; then
+ echo "use --force-dir to override the existing directory: ${TARGET}/${FILE}"
+ continue # allow unlinked directories
+ elif [ -f "${TARGET}/${FILE}" ] && [ "${FORCE_FILE}" = 'no' ]; then
+ echo "use --force-file to override the existing target: ${TARGET}/${FILE}"
+ continue # target already exists
+ fi