Skip to content

Instantly share code, notes, and snippets.

@adam12

adam12/ruby-exec Secret

Created December 31, 2019 18:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adam12/fd8d5873167400deee8af9e27be4dc90 to your computer and use it in GitHub Desktop.
Save adam12/fd8d5873167400deee8af9e27be4dc90 to your computer and use it in GitHub Desktop.
#!/bin/sh
version="$1"; shift
bin="$1"; shift
binpath="$HOME/.rubies/$version/bin/$bin"
if [ -z "$version" ] || [ -z "$bin" ]; then
echo "$(basename "$0") <version> <bin> [args]" >&2
exit 1
fi
if [ ! -x "$binpath" ]; then
echo "Unable to find '$binpath'" >&2
exit 1
fi
exec "$binpath" "$@"
# vim:ts=2:sts=2:sw=2:et:ft=sh:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment