Skip to content

Instantly share code, notes, and snippets.

@xuhdev
Last active September 3, 2019 08:29
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xuhdev/7127799 to your computer and use it in GitHub Desktop.
Save xuhdev/7127799 to your computer and use it in GitHub Desktop.
Wrap executables installed by Macports
#!/bin/sh
## Wrap Macports command (any executables installed by Macports).
if [ "$#" -le 0 ]; then
echo "Usage: $0 command [arg1, arg2, ...]" >&2
exit 1
fi
if [[ -z $MACPORTS_PREFIX ]]; then
MACPORTS_PREFIX='/opt/local'
fi
export PATH="$MACPORTS_PREFIX/bin:$MACPORTS_PREFIX/sbin:$PATH"
export CPATH="$MACPORTS_PREFIX/include:$CPATH"
command=$1
shift
exec $command $*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment