I have this run as a Shell Script target in my Xcode project
# shell script goes here
genstrings -u -a -o en.lproj *[hmc] */*[hmc] */*/*[hmc]
if [ -f "$PROJECT_DIR/build/Release-macosx/UnicodeEscape" ] then
build/Release-macosx/UnicodeEscape "en.lproj/Localizable.strings"
elif [ -f "$PROJECT_DIR/build/Debug-macosx/UnicodeEscape" ] then
build/Debug-macosx/UnicodeEscape "en.lproj/Localizable.strings"
fi
exit 0
I get this error:
/Users/aa/Dropbox/Developer/Pandamonia
LLC/iPhone/Acey Deucey/build/Acey
Deucey.build/Release/GenerateLocalizedStrings.build/Script-00F66869125625D9009F14DA.sh:
line 7: syntax error near unexpected
tokenelif'elif [ -f
/Users/aa/Dropbox/Developer/Pandamonia
LLC/iPhone/Acey Deucey/build/Acey
Deucey.build/Release/GenerateLocalizedStrings.build/Script-00F66869125625D9009F14DA.sh:
line 7:
“$PROJECT_DIR/build/Debug-macosx/UnicodeEscape” ] then’ Command /bin/sh failed with
exit code 2
First of all, do not tag it
bashandsh, you have one shell, typeecho $SHELLto know which shell you use, or put a shebang at the start of your script (#!/usr/bin/env bash)put semicolons after your commands, including
[…]which is an alias fortest. Command terminators are newline,;,&&,||and&and are mandatory. You can put several commands betweenifandthen, so those semicolons are mandatory.