You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The user may want to change the verbosity of .travis.yml output so I should not assume those settings. Instead store the values and revert to them before exiting the function.
I removed the unnecessary calls to enable_verbosity and disable_verbosity in the private functions as verbosity control will already be handled in the public functions and extra calls will cause the loss of the saved verbosity values as well as changing the verbosity of the rest of the public function after the private function call.
# Return verbosity settings to their previous values
111
111
functiondisable_verbosity()
112
112
{
113
-
set +o verbose
114
-
set +o xtrace
113
+
if [[ "$ARDUINO_CI_SCRIPT_PREVIOUS_VERBOSE_SETTING"=="0" ]];then
114
+
set -o verbose
115
+
else
116
+
set +o verbose
117
+
fi
118
+
119
+
if [[ "$ARDUINO_CI_SCRIPT_PREVIOUS_XTRACE_SETTING"=="0" ]];then
120
+
set -o xtrace
121
+
else
122
+
set +o xtrace
123
+
fi
115
124
}
116
125
117
126
@@ -141,12 +150,8 @@ function set_sketchbook_folder()
141
150
# Deprecated
142
151
functionset_parameters()
143
152
{
144
-
enable_verbosity
145
-
146
153
set_application_folder "$1"
147
154
set_sketchbook_folder "$2"
148
-
149
-
disable_verbosity
150
155
}
151
156
152
157
@@ -243,8 +248,6 @@ function install_ide()
243
248
# This function allows the same code to be shared by install_ide and build_sketch. The generated array is "returned" as a global named "$ARDUINO_CI_SCRIPT_GENERATED_IDE_VERSION_LIST_ARRAY"
244
249
functiongenerate_ide_version_list_array()
245
250
{
246
-
enable_verbosity
247
-
248
251
local baseIDEversionArray="$1"
249
252
local startIDEversion="$2"
250
253
local endIDEversion="$3"
@@ -319,17 +322,13 @@ function generate_ide_version_list_array()
# Determine the oldest and newest (non-hourly unless hourly is the only version on the list) IDE version in the provided array
328
329
# The determined versions are "returned" by setting the global variables "$ARDUINO_CI_SCRIPT_DETERMINED_OLDEST_IDE_VERSION" and "$ARDUINO_CI_SCRIPT_DETERMINED_NEWEST_IDE_VERSION"
329
330
functiondetermine_ide_version_extremes()
330
331
{
331
-
enable_verbosity
332
-
333
332
local baseIDEversionArray="$1"
334
333
335
334
# Reset the variables from any value they were assigned the last time the function was ran
@@ -347,21 +346,15 @@ function determine_ide_version_extremes()
# Fold this section of output in the Travis CI build log to make it easier to read
682
675
echo -e "travis_fold:start:build_sketch"
683
676
684
-
enable_verbosity
685
-
686
677
local sketchName="$1"
687
678
local boardID="$2"
688
679
local IDEversion="$3"
@@ -762,8 +753,6 @@ function build_this_sketch()
762
753
echo -e "travis_fold:end:build_sketch"
763
754
# Add a useful message to the Travis CI build log
764
755
765
-
disable_verbosity
766
-
767
756
echo"arduino exit code: $arduinoExitCode"
768
757
769
758
return$buildThisSketchExitCode
@@ -908,14 +897,10 @@ curlDataHere
908
897
# Leave a comment on the commit with a link to the report
909
898
functioncomment_report_link()
910
899
{
911
-
enable_verbosity
912
-
913
900
local token="$1"
914
901
local reportURL="$2"
915
902
916
903
eval curl $ARDUINO_CI_SCRIPT_VERBOSITY_OPTION --header "\"Authorization: token ${token}\"" --data \"{'\"'body'\"':'\"'Once completed, the job reports for Travis CI [build ${TRAVIS_BUILD_NUMBER}]\(https://travis-ci.org/${TRAVIS_REPO_SLUG}/builds/${TRAVIS_BUILD_ID}\) will be found at:\\n${reportURL}'\"'}\""\"https://api.github.com/repos/${TRAVIS_REPO_SLUG}/commits/${TRAVIS_COMMIT}/comments\"""$ARDUINO_CI_SCRIPT_VERBOSITY_REDIRECT"
0 commit comments