Project

General

Profile

« Previous | Next » 

Revision 1977

vegbien_dest: Fixed bug where it would give a usage error if run from a makefile rule, because the BASH_LINENO would be 0, by also checking if ${BASH_ARGV0} is ${BASH_SOURCE0}

View differences:

bin/vegbien_dest
5 5
    local self="${BASH_SOURCE[0]}"
6 6
    local selfDir="$(dirname -- "$self")"
7 7
    
8
    if test "${BASH_LINENO[1]}" = 0; then # was run without initial "."
8
    # Was run without initial "."
9
    if test "${BASH_LINENO[1]}" = 0 -a "${BASH_ARGV[0]}" != "$self"; then
9 10
        echo "Usage: . $self (note initial \".\")"|fold -s >&2
10 11
        return 2
11 12
    fi

Also available in: Unified diff