Sha256: 500c11cacbcde646c68ae99fa2033b0b524f8796f31bac94b3bebe3d27b2a7a8

Contents?: true

Size: 488 Bytes

Versions: 8

Compression:

Stored size: 488 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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
foreman-0.37.0.pre4-mingw32 bin/runner
foreman-0.37.0.pre4-java bin/runner
foreman-0.37.0.pre4 bin/runner
foreman-0.37.0.pre3-mingw32 bin/runner
foreman-0.37.0.pre3-java bin/runner
foreman-0.37.0.pre3 bin/runner
foreman-0.37.0.pre2-java bin/runner
foreman-0.37.0.pre2 bin/runner