X-Git-Url: https://iankelling.org/git/?p=distro-setup;a=blobdiff_plain;f=conflink;h=0ae24c332cce236812b3d2521bd332edd8f96934;hp=aecd0377119a99daf04b7d0e497e65c46f729de0;hb=79b274fcd8bfa556133ab13270e84b40aebe8468;hpb=36f92d5af79d7934e953515f58af1c86d6838599 diff --git a/conflink b/conflink index aecd037..0ae24c3 100755 --- a/conflink +++ b/conflink @@ -24,14 +24,27 @@ m() { s() { sudo "$@"; } lnf() { /a/exe/lnf "$@"; } +now=$(date +%s) + +# error prone +#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 +177,3 @@ case $user in echo "$0: error: unexpected user"; exit 1 ;; esac -