X-Git-Url: https://iankelling.org/git/?a=blobdiff_plain;f=conflink;h=d72f98c29e775a1aa7b6bbf9c0a7689687864c3c;hb=e03e99848bc5fbc7ad527513e0aa4b0fc9c4d6fb;hp=aecd0377119a99daf04b7d0e497e65c46f729de0;hpb=36f92d5af79d7934e953515f58af1c86d6838599;p=distro-setup diff --git a/conflink b/conflink index aecd037..d72f98c 100755 --- a/conflink +++ b/conflink @@ -24,14 +24,25 @@ m() { s() { sudo "$@"; } lnf() { /a/exe/lnf "$@"; } +now=$(date +%s) +f=~/.local/conflink +fast=false +if [[ -e $f ]] && (( $(stat -c %Y $f) > $now - 60*60*24 )); then + fast=true +fi if [[ $1 == -f ]]; then # f for fast - lnf() { ln -sf "$@"; } + fast=true + shift elif [[ $1 ]]; then echo "error: unrecognized arguments" >&2 exit 0 fi +if $fast; then + lnf() { ln -sf "$@"; } +fi + shopt -s nullglob shopt -s extglob shopt -s dotglob @@ -164,4 +175,3 @@ case $user in echo "$0: error: unexpected user"; exit 1 ;; esac -