Sha256: 1fae9182c9609bb63c0c22052f928ca4f109502bc6dc1a4a1c1ef46203b48df4

Contents?: true

Size: 1.94 KB

Versions: 15

Compression:

Stored size: 1.94 KB

Contents

#!/usr/bin/env bash

function emit-stack-trace {
    local -i x
    local -i stack_frames="${#FUNCNAME[@]}"

    {
        echo "ERROR in ${FUNCNAME[1]}() at ${BASH_SOURCE[1]}:${BASH_LINENO[0]}"

        for (( x=2; x < stack_frames; x++ ))
        do
            echo "called by ${FUNCNAME[x]}() at ${BASH_SOURCE[x]}:${BASH_LINENO[x - 1]}"
        done
    } >&2
} # end emit-stack-trace()

function strict-errors {
    set -o errexit
    set -o errtrace

    trap emit-stack-trace ERR
} # end strict-errors()

function loose-errors {
    set +o errexit
    set +o errtrace

    trap - ERR
} # end loose-errors()


strict-errors


# "dirname $0" does not work if we were invoked via a symlink, so we've got to
# go through this fun.  See http://mywiki.wooledge.org/BashFAQ/028
if readlink -e /dev/null &>/dev/null
then
    # GNU readlink(1)
    self="$(readlink -e "${BASH_SOURCE[0]}")"
else
    # BSD readlink(1)
    loose-errors
    self="${BASH_SOURCE[0]}"
    if [[ ! $self =~ ^/ ]]
    then
        if [[ $self =~ / ]]
        then
            self="$PWD/$self"
        else
            echo 'Could not determine base directory for Fig.' >&2
            exit 1
        fi
    fi

    self_link="$(! readlink -n "$self")"
    while [[ -n $self_link ]]
    do
        if [[ ! $self_link =~ ^/ ]]
        then
            self_link="$(dirname "$self")/$self_link"
        fi

        self="$self_link"
        self_link="$(! readlink -n "$self")"
    done
    strict-errors
fi

fig_dir=$(dirname "$self")


# No longer strict on errors; let Ruby code determine how this script exits.
loose-errors


exec ruby                                                               \
    --external-encoding UTF-8                                           \
    --internal-encoding UTF-8                                           \
    -r "$fig_dir/../lib/fig/command/initialization.rb"                  \
    -e 'exit Fig::Command.new.run_fig_with_exception_handling ARGV'     \
    -- "$@"

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
fig-1.27.10 bin/fig
fig-1.27.8 bin/fig
fig-1.27.5 bin/fig
fig-1.27.4 bin/fig
fig-1.27.3 bin/fig
fig-1.27.0 bin/fig
fig-1.26.1.beta.1 bin/fig
fig-1.26.0 bin/fig
fig-1.25.1.beta.1 bin/fig
fig-1.25.0 bin/fig
fig-1.24.1.beta.3 bin/fig
fig-1.24.1.beta.2 bin/fig
fig-1.24.1.beta.1 bin/fig
fig-1.24.0 bin/fig
fig-1.23.1.beta.1 bin/fig