Skip to content

Commit e50820c

Browse files
committed
Remove unnecessary usage of $PIPESTATUS
The Travis CI documentation led me to believe that $? is universally unusable but I've come to realize this is only true in .travis.yml, not in the script.
1 parent a7fbb38 commit e50820c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arduino-ci-script.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,7 @@ function publish_report_to_repository()
801801
if [[ "$token" != "" ]] && [[ "$repositoryURL" != "" ]] && [[ "$reportBranch" != "" ]]; then
802802
if [ -e "$ARDUINO_CI_SCRIPT_REPORT_FILE_PATH" ]; then
803803
# Location is a repository
804-
git clone --quiet --branch "$reportBranch" "$repositoryURL" "${HOME}/report-repository"; local gitCloneExitCode="${PIPESTATUS[0]}"
805-
if [[ "$gitCloneExitCode" == 0 ]]; then
804+
if git clone --quiet --branch "$reportBranch" "$repositoryURL" "${HOME}/report-repository"; then
806805
# Clone was successful
807806
create_folder "${HOME}/report-repository/${reportFolder}"
808807
cp $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION "$ARDUINO_CI_SCRIPT_REPORT_FILE_PATH" "${HOME}/report-repository/${reportFolder}"
@@ -826,7 +825,8 @@ function publish_report_to_repository()
826825
pushCount=$((pushCount + 1))
827826
# Do a pull now in case another job has finished about the same time and pushed a report since the last pull. This would require a merge or rebase. Rebase should be safe since the commits will be separate files.
828827
git pull $ARDUINO_CI_SCRIPT_QUIET_OPTION --rebase
829-
git push $ARDUINO_CI_SCRIPT_QUIET_OPTION $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION "https://${token}@${repositoryURL#*//}"; local gitPushExitCode="${PIPESTATUS[0]}"
828+
git push $ARDUINO_CI_SCRIPT_QUIET_OPTION $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION "https://${token}@${repositoryURL#*//}"
829+
local gitPushExitCode="$?"
830830
done
831831
rm --recursive --force "${HOME}/report-repository"
832832
if [[ "$gitPushExitCode" == "0" ]]; then

0 commit comments

Comments
 (0)