Sha256: 41eb92cb5477e923b6b301f2819743e169e99c05b887a3725ae9fc206b1e0a92

Contents?: true

Size: 487 Bytes

Versions: 6

Compression:

Stored size: 487 Bytes

Contents

#!/bin/sh
#
#/ Usage: runner [-d <dir>] <command>
#/
#/ Run a command with exec, optionally changing directory first

set -e

error() {
  echo $@ >&2
  exit 1
}

usage() {
  cat $0 | grep '^#/' | cut -c4-
  exit
}

while getopts ":hd:" OPT; do
  case $OPT in
     d) cd "$OPTARG" ;;
     h) usage ;;
    \?) error "invalid option: -$OPTARG" ;;
     :) error "option -$OPTARG requires an argument" ;;
  esac
done

shift $((OPTIND-1))

command=$1

if [ -z "$1" ]; then
  usage
fi

exec $1

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman-0.38.0-mingw32 bin/runner
foreman-0.38.0-java bin/runner
foreman-0.38.0 bin/runner
foreman-0.37.2-mingw32 bin/runner
foreman-0.37.2-java bin/runner
foreman-0.37.2 bin/runner