2015-10-01 21:16:02 -07:00
|
|
|
#!/bin/sh
|
2015-09-22 16:34:24 -07:00
|
|
|
|
2015-10-01 21:16:02 -07:00
|
|
|
# run
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015 Crashlytics. All rights reserved.
|
2015-09-22 16:34:24 -07:00
|
|
|
|
2015-10-01 21:16:02 -07:00
|
|
|
# Figure out where we're being called from
|
|
|
|
DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
|
2015-09-22 16:34:24 -07:00
|
|
|
|
2015-10-01 21:16:02 -07:00
|
|
|
# Replace any spaces with escaped spaces: "\ "
|
|
|
|
DIR="${DIR// /\ }"
|
2015-09-22 16:34:24 -07:00
|
|
|
|
2015-10-01 21:16:02 -07:00
|
|
|
PATH_SEP="/"
|
|
|
|
VALIDATE_COMMAND="uploadDSYM $@ validate"
|
|
|
|
UPLOAD_COMMAND="uploadDSYM $@"
|
2015-09-22 16:34:24 -07:00
|
|
|
|
2015-10-01 21:16:02 -07:00
|
|
|
# Ensure params are as expected, run in sync mode to validate
|
|
|
|
eval $DIR$PATH_SEP$VALIDATE_COMMAND
|
|
|
|
return_code=$?
|
2015-09-22 16:34:24 -07:00
|
|
|
|
2015-10-01 21:16:02 -07:00
|
|
|
if [[ $return_code != 0 ]]; then
|
|
|
|
exit $return_code
|
|
|
|
fi
|
2015-09-22 16:34:24 -07:00
|
|
|
|
2015-10-01 21:16:02 -07:00
|
|
|
# Verification passed, upload dSYM in background to prevent Xcode from waiting
|
|
|
|
# Note: Validation is performed again before upload.
|
|
|
|
# Output can still be found in Console.app
|
|
|
|
eval $DIR$PATH_SEP$UPLOAD_COMMAND > /dev/null 2>&1 &
|