Skip to content

Commit 9e85ff9

Browse files
authored
Merge pull request #656 from bashly-framework/change/min-bash-version
Update bash version bouncer to require bash 4.2
2 parents 9726e44 + ccd7b92 commit 9e85ff9

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

lib/bashly/libraries/strings/strings.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@ examples_caption_on_error: 'examples:'
4040
disallowed_flag: "%{name} must be one of: %{allowed}"
4141
disallowed_argument: "%{name} must be one of: %{allowed}"
4242
disallowed_environment_variable: "%{name} environment variable must be one of: %{allowed}"
43-
unsupported_bash_version: "bash version 4 or higher is required"
43+
unsupported_bash_version: "bash version 4.2 or higher is required"
4444
validation_error: "validation error in %s:\\n%s"
4545
environment_variable_validation_error: "validation error in environment variable %s:\\n%s"
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
= view_marker
22

3-
> if [[ "${BASH_VERSINFO:-0}" -lt 4 ]]; then
3+
> if ((BASH_VERSINFO[0] < 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] < 2))); then
44
> printf "{{ strings[:unsupported_bash_version] }}\n" >&2
55
> exit 1
66
> fi
7-
>
7+
>
8+
9+
10+

spec/approvals/bash/error

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
bash version 4 or higher is required
1+
bash version 4.2 or higher is required

spec/approvals/script/wrapper/code

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
# Modifying it manually is not recommended
44

55
# :wrapper.bash3_bouncer
6-
if [[ "${BASH_VERSINFO:-0}" -lt 4 ]]; then
7-
printf "bash version 4 or higher is required\n" >&2
6+
if ((BASH_VERSINFO[0] < 4 || (BASH_VERSINFO[0] == 4 && BASH_VERSINFO[1] < 2))); then
7+
printf "bash version 4.2 or higher is required\n" >&2
88
exit 1
99
fi
1010

0 commit comments

Comments
 (0)