Sha256: 629d326d914c2d1317d747a773abf2f29c5f8ce680798e62e233408f726d0211

Contents?: true

Size: 493 Bytes

Versions: 2

Compression:

Stored size: 493 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 [ "$1" == "" ]; then
  usage
fi

exec $1 2>&1

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman-0.37.0.pre1-java bin/runner
foreman-0.37.0.pre1 bin/runner