diff --git a/README b/README index 88e35c5..1f1f1c8 100644 --- a/README +++ b/README @@ -44,7 +44,8 @@ order to automate this, you may want to add this line to your Bash shell. Since dotfiles are not expected to change rapidly, the ``update`` command remembers the last time it ran and only actually performs the update if it has been at least a week since the last -update. +update. To ignore this weekly timer, pass the ``--ignore-timer`` flag to +``update``. If you're using Git, you may have a choice of transport protocols for accessing the central repository. Some protocols (e.g. SSH) often diff --git a/dotfiles.sh b/dotfiles.sh index 5f0c5e5..fd225d5 100755 --- a/dotfiles.sh +++ b/dotfiles.sh @@ -22,6 +22,7 @@ VERSION='0.4' DOTFILES_DIR="${PWD}" TARGET=~ CHECK_WGET_TYPE_AND_ENCODING='no' +IGNORE_TIMER='no' ##### # External utilities @@ -772,7 +773,13 @@ function update() { LINK_OPTS='' while [ "${1::2}" = '--' ]; do - LINK_OPTS="${LINK_FN_OPTS} ${1}" + case "${1}" in + '--ignore-timer') + IGNORE_TIMER='yes' + ;; + *) + LINK_OPTS="${LINK_FN_OPTS} ${1}" + esac shift done # multi-repo case handled in main() by run_on_all_repos() @@ -783,7 +790,7 @@ function update() # touching this file. UPDATE_FILE="${REPO}/updated.$(date +%U)" - if [ ! -e "${UPDATE_FILE}" ]; then + if [ ! -e "${UPDATE_FILE}" ] || [ "${IGNORE_TIMER}" = 'yes' ]; then echo "update ${REPO} dotfiles" "${RM}" -f "${REPO}"/updated.* || return 1 "${TOUCH}" "${UPDATE_FILE}" || return 1