view .bash_overrides @ 929:7c4be71a560b default tip

remove old aliases
author Jeff Hammel <k0scist@gmail.com>
date Mon, 20 Oct 2025 15:22:19 -0700
parents 753b1c2bd64c
children
line wrap: on
line source

function emacsclient() {
    command emacsclient $@ > /dev/null &
}

# make hg safer since $HOME is versioned
function hg {
    if [[ "$(command hg root)" == "${HOME}" ]]
    then
        if [[ "$*" == st* ]]
        then
            command hg st -q
            return
        fi
        if [[ "$*" == res* ]] || [[ "$*" == pur* ]]
        then
            echo "Aborting \'hg $*\'; hg root is ${HOME}!"
            return 1
        fi
    fi
    command hg "$@"
}

function lsdiff {
    # TODO: extract this general pattern as a bash "decorator"
    if expr "$1" : 'http[s]\?://.*' &> /dev/null
    then
        curl --location "$1" 2> /dev/null | command lsdiff
    else
        command lsdiff "$@"
    fi

}