Hacker News new | ask | show | jobs
by chris_wot 3697 days ago
Here's a better version:

  mkdir -p ~/xcls/usr/bin
  cat <<EOF > ~/xcls/usr/bin/xcrun
  #!/bin/sh
  if [ "\$1" = "git" ];
  then
     echo "Hello world!"
     exit \$?
  fi
    
  shift 1
  xcrun "\$@"
  exit \$?
  EOF
  chmod a+x ~/xcls/usr/bin/xcrun
  chflags hidden ~/xcls
  echo "export DEVELOPER_DIR=~/xcls/" >> ~/.bashrc
  export DEVELOPER_DIR=~/xcls/
Results in:

  630188s-iMac:testrun 5K$ git HelloWorld
  Hello world!