3 ms·
Thank you :-) You can also do the following (take out the leading spaces...): mkdir -p ~/xcls/usr/bin cat <<EOF > ~/xcls/usr/bin/xcrun #!/bin/sh if [
by chris_wot 11y ago
Thank you :-)
You can also do the following (take out the leading spaces...):
mkdir -p ~/xcls/usr/bin
cat <<EOF > ~/xcls/usr/bin/xcrun
#!/bin/sh
if [ "\$1" = "git" ];
then
shift 1
ls "\$@"
exit \$?
fi
unset DEVELOPER_DIR
shift 1
xcrun "\$@"
exit \$?
EOF
chmod a+x ~/xcls/usr/bin/xcrun
I get the following:
630188s-iMac:~ 5K$ mkdir ~/testrun
630188s-iMac:~ 5K$ touch ~/testrun/testfile
630188s-iMac:~ 5K$ cd ~/testrun
630188s-iMac:testrun 5K$ DEVELOPER_DIR=~/xcls/ git -l
total 0
-rw-r--r-- 1 5K staff 0 8 May 12:03 testfile
As you can see, no need for sudo. :-)