File tree Expand file tree Collapse file tree 3 files changed +11
-17
lines changed
Expand file tree Collapse file tree 3 files changed +11
-17
lines changed Original file line number Diff line number Diff line change @@ -6,16 +6,6 @@ function is_git_installed() {
66 command -v git > /dev/null 2>&1
77}
88
9- function get_latest_tag() {
10- local repository_url=$1
11-
12- git ls-remote --tags " $repository_url " |
13- awk ' {print $2}' |
14- sed ' s|^refs/tags/||' |
15- sort -Vr |
16- head -n 1
17- }
18-
199function build_and_install_beta() {
2010 echo " > Downloading non-stable version: 'beta'"
2111
@@ -92,11 +82,7 @@ elif [[ $# -eq 2 ]]; then
9282fi
9383
9484BASHUNIT_GIT_REPO=" https://github.com/TypedDevs/bashunit"
95- if is_git_installed; then
96- LATEST_BASHUNIT_VERSION=" $( get_latest_tag " $BASHUNIT_GIT_REPO " ) "
97- else
98- LATEST_BASHUNIT_VERSION=" 0.22.2"
99- fi
85+ LATEST_BASHUNIT_VERSION=" 0.22.2"
10086TAG=" $LATEST_BASHUNIT_VERSION "
10187
10288cd " $( dirname " $0 " ) "
Original file line number Diff line number Diff line change @@ -87,13 +87,17 @@ function env::is_no_output_enabled() {
8787}
8888
8989function env::active_internet_connection() {
90+ if [[ " ${BASHUNIT_NO_NETWORK:- } " == " true" ]]; then
91+ return 1
92+ fi
93+
9094 if command -v curl > /dev/null 2>&1 ; then
9195 curl -sfI https://github.com > /dev/null 2>&1 && return 0
9296 elif command -v wget > /dev/null 2>&1 ; then
9397 wget -q --spider https://github.com && return 0
9498 fi
9599
96- if ping -c 1 -W 3 github .com & > /dev/null; then
100+ if ping -c 1 -W 3 google .com & > /dev/null; then
97101 return 0
98102 fi
99103
Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ function tear_down_after_script() {
2828
2929function set_up() {
3030 ./build.sh " $TMP_DIR " > /dev/null
31- LATEST_VERSION=" $( helpers::get_latest_tag) "
31+ if [[ " $ACTIVE_INTERNET " == true ]] && [[ " $HAS_GIT " == true ]]; then
32+ LATEST_VERSION=" $( helpers::get_latest_tag) "
33+ else
34+ LATEST_VERSION=" ${BASHUNIT_VERSION} "
35+ fi
3236 TEST_ENV_FILE=" tests/acceptance/fixtures/.env.default"
3337}
3438
You can’t perform that action at this time.
0 commit comments