File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ and this project adheres to [Semantic Versioning].
1010 - Travis CI shared configuration snippet intented to be sourced in user
1111 configuration (` dev.yml ` ).
1212
13+ ### Fixed
14+ - Filtering of daily build (available through Chocolatey) (#9 ).
15+
1316## [ 0.1.2] - 2020-01-13
1417### Fixed
1518 - Recommended way of sourcing the ` travis-python.bash ` script (#2 ).
Original file line number Diff line number Diff line change @@ -44,13 +44,13 @@ Describe "__latest_matching_version()"
4444 End
4545
4646 It " filters release candidates"
47- When call __latest_matching_version " 3.7" " 3.7.6" " 3.7.6rc1 " " 3.7. 6rc2"
47+ When call __latest_matching_version " 3.7" " 3.7.6" " 3.7.6rc2"
4848 The output should equal " 3.7.6"
4949 End
5050
51- It " filters sources versions "
52- When call __latest_matching_version " pypy-5 .7" " pypy-5 .7.1 " " pypy-5 .7.1-src "
53- The output should equal " pypy-5 .7.1 "
51+ It " filters daily builds "
52+ When call __latest_matching_version " 3 .7" " 3 .7.6 " " 3 .7.6.20200125 "
53+ The output should equal " 3 .7.6 "
5454 End
5555
5656 Parameters
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ __windows_path() {
8080
8181 if [[ $converted == \\ * ]]; then
8282 # If it is an absolute path, convert the first component to a drive letter
83- drive_letter=$( tr ' [:lower:]' ' [:upper:]' <<< " ${converted:1:1}" )
83+ drive_letter=$( tr ' [:lower:]' ' [:upper:]' <<< " ${converted:1:1}" )
8484 converted=" $drive_letter :${converted: 2} "
8585 fi
8686
@@ -96,7 +96,7 @@ __latest_matching_version() {
9696 # specifier can be a complete version (major.minor.patch) or omit one or
9797 # more leading components.
9898 #
99- # Only stable versions are considered ()
99+ # Only stable versions are considered.
100100 #
101101 local -r specifier=${1:? the specifier must be specified}
102102 local -r specifier_pattern=${specifier// ./ " \." }
@@ -116,12 +116,15 @@ __latest_matching_version() {
116116 shopt -s extglob
117117
118118 for version in " ${versions[@]} " ; do
119- if [[ $version =~ ^${specifier_pattern} (\. [[:digit:]]+)* $ ]]; then
119+ if [[ $version =~ ^[[:digit:]]+ (\. [[:digit:]]+){2}$ && \
120+ $version =~ ^${specifier_pattern} ]]; then
120121 found_version=" $version "
121122 fi
122123 done
123124
124- [[ -n $found_version ]] || return
125+ if [[ -z $found_version ]]; then
126+ return 1
127+ fi
125128
126129 echo " $found_version "
127130}
You can’t perform that action at this time.
0 commit comments