Trying to run a simple script attached to my xcode project as follows...
if [ -d '$HOME/data' ];
then
cd "$HOME/data/"
rsync -t *.plist '$SRCROOT/data/'
fi
exit 0
The script seems to run fine if I run it outside of XCode but when running from XCode I'm getting the following error...
line 2: SRCROOT: command not found
Seems the SRCROOT variable isn't detectable in the script but my understanding was that this is one of the environment variables that should be passed and accessible to the script. Any thought?
Turns out this was my fault. The script was actually not being called at all. In XCode I was referring to the path of the script using...
"./$(SRCROOT)/myScript.sh"
Switching it to...
"$SRCROOT/myScript.sh"
Corrected the problem and indeed I can access $SRCROOT from my script now.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With