Skip to content

Commit 51f324a

Browse files
authored
Merge pull request #4 from marverix/add-osx-and-x64
feat: Add osx and x64 keywords
2 parents 431b220 + 1170d82 commit 51f324a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

gah

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ function get_os() {
9696
function get_os_regexp_part() {
9797
case $(get_os) in
9898
linux) echo '[._-](unknown[._-])?(linux|linux-gnu|linux-musl)' ;;
99-
macos) echo '[._-](apple[._-])?(darwin|macos)' ;;
99+
macos) echo '[._-](apple[._-])?(darwin|macos|osx)' ;;
100100
*) throw_error 10 "Your OS type is not supported" ;;
101101
esac
102102
}
@@ -112,7 +112,7 @@ function get_arch() {
112112

113113
function get_arch_regexp_part() {
114114
case $(get_arch) in
115-
amd64) echo '[._-](amd64|x86_64|universal)' ;;
115+
amd64) echo '[._-](amd64|x86_64|x64|universal)' ;;
116116
arm64) echo '[._-](arm64|aarch64|universal)' ;;
117117
*) throw_error 11 "Your CPU/OS architecture is not supported" ;;
118118
esac

test/01_regexp_functions.bats

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ teardown() {
6767
run get_os_regexp_part
6868

6969
assert_success
70-
assert_output '[._-](apple[._-])?(darwin|macos)'
70+
assert_output '[._-](apple[._-])?(darwin|macos|osx)'
7171
}
7272

7373
@test "get_os_regexp_part should exit with error code" {
@@ -130,7 +130,7 @@ teardown() {
130130
run get_arch_regexp_part
131131

132132
assert_success
133-
assert_output '[._-](amd64|x86_64|universal)'
133+
assert_output '[._-](amd64|x86_64|x64|universal)'
134134
}
135135

136136
@test "get_arch_regexp_part should return proper string for arm64 architecture" {
@@ -157,7 +157,7 @@ teardown() {
157157
run get_filename_regexp
158158

159159
assert_success
160-
assert_output '([a-z][a-z0-9_-]+?)([_-]v?[0-9.]+)?([._-](unknown[._-])?(linux|linux-gnu|linux-musl)[._-](amd64|x86_64|universal)|[._-](amd64|x86_64|universal)[._-](unknown[._-])?(linux|linux-gnu|linux-musl))(\.zip|\.tar\.gz|\.tar\.xz|\.tar\.bz2)?'
160+
assert_output '([a-z][a-z0-9_-]+?)([_-]v?[0-9.]+)?([._-](unknown[._-])?(linux|linux-gnu|linux-musl)[._-](amd64|x86_64|x64|universal)|[._-](amd64|x86_64|x64|universal)[._-](unknown[._-])?(linux|linux-gnu|linux-musl))(\.zip|\.tar\.gz|\.tar\.xz|\.tar\.bz2)?'
161161
}
162162

163163
@test "get_filename_regexp should return proper string for linux/arm64" {
@@ -179,7 +179,7 @@ teardown() {
179179
run get_filename_regexp
180180

181181
assert_success
182-
assert_output '([a-z][a-z0-9_-]+?)([_-]v?[0-9.]+)?([._-](apple[._-])?(darwin|macos)[._-](amd64|x86_64|universal)|[._-](amd64|x86_64|universal)[._-](apple[._-])?(darwin|macos))(\.zip|\.tar\.gz|\.tar\.xz|\.tar\.bz2)?'
182+
assert_output '([a-z][a-z0-9_-]+?)([_-]v?[0-9.]+)?([._-](apple[._-])?(darwin|macos|osx)[._-](amd64|x86_64|x64|universal)|[._-](amd64|x86_64|x64|universal)[._-](apple[._-])?(darwin|macos|osx))(\.zip|\.tar\.gz|\.tar\.xz|\.tar\.bz2)?'
183183
}
184184

185185
@test "get_filename_regexp should return proper string for macos/arm64" {
@@ -190,5 +190,5 @@ teardown() {
190190
run get_filename_regexp
191191

192192
assert_success
193-
assert_output '([a-z][a-z0-9_-]+?)([_-]v?[0-9.]+)?([._-](apple[._-])?(darwin|macos)[._-](arm64|aarch64|universal)|[._-](arm64|aarch64|universal)[._-](apple[._-])?(darwin|macos))(\.zip|\.tar\.gz|\.tar\.xz|\.tar\.bz2)?'
193+
assert_output '([a-z][a-z0-9_-]+?)([_-]v?[0-9.]+)?([._-](apple[._-])?(darwin|macos|osx)[._-](arm64|aarch64|universal)|[._-](arm64|aarch64|universal)[._-](apple[._-])?(darwin|macos|osx))(\.zip|\.tar\.gz|\.tar\.xz|\.tar\.bz2)?'
194194
}

0 commit comments

Comments
 (0)