#!/bin/sh set -eu test || __() { :; } generate() { file="$1" && shift if [ -e "$file" ]; then set -- exist "$file" else case "$file" in (*/*) mkdir -p "${file%/*}" esac [ $# -eq 0 ] && set -- "$(cat)" "$SHELLSPEC_PRINTF" '%s\n' "$@" > "$file" set -- create "$file" fi relpath=${2#"$SHELLSPEC_CWD"} [ "$relpath" = "$2" ] && set -- "$1" "${SHELLSPEC_CWD%/}/$2" "$SHELLSPEC_PRINTF" '%8s %s\n' "$1" "$2" } spec() { eval "$1=\$3 $2=\$(cat)" } ignore_file() { [ "${2:-}" ] && echo "$2" echo "${1:-}.shellspec-local" echo "${1:-}.shellspec-quick.log" echo "${1:-}$SHELLSPEC_REPORTDIR/" echo "${1:-}$SHELLSPEC_COVERAGEDIR/" } default_options() { echo "--require spec_helper" if [ ! "$SHELLSPEC_HELPERDIR" = "spec" ]; then echo "--helperdir $SHELLSPEC_HELPERDIR" fi } ${__SOURCED__:+return} __ main __ generate ".shellspec" <