Skip to content

Commit 3cca982

Browse files
authored
Merge pull request #478 from codacy/arm-support
Use Java version on architectures other than x86_64
2 parents 9a5836d + 0e91347 commit 3cca982

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

get.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,15 @@ download() {
130130

131131
download_file "$url"
132132
checksum "$file_name" "$checksum_url"
133-
if [ "$os_name" = "Linux" ] || [ "$os_name" = "Darwin" ]; then
133+
if [ "$os_name_arch" = "Linux x86_64" ] || [ "$os_name_arch" = "Darwin x86_64" ]; then
134134
mv "$file_name" "$output_filename"
135135
fi
136136

137137
cd "$original_folder"
138138
}
139139

140140
download_reporter() {
141-
if [ "$os_name" = "Linux" ] || [ "$os_name" = "Darwin" ]; then
141+
if [ "$os_name_arch" = "Linux x86_64" ] || [ "$os_name_arch" = "Darwin x86_64" ]; then
142142
# OS name lower case
143143
suffix=$(echo "$os_name" | tr '[:upper:]' '[:lower:]')
144144
else
@@ -176,6 +176,7 @@ is_self_hosted_instance() {
176176
}
177177

178178
os_name=$(uname)
179+
os_name_arch=$(uname -sm)
179180

180181
# This version should be one that matches the latest self hosted release.
181182
SELF_HOSTED_CODACY_REPORTER_VERSION="13.13.9"
@@ -203,7 +204,7 @@ if [ -z "$CODACY_REPORTER_TMP_FOLDER" ]; then
203204
fi
204205

205206
# Set binary name
206-
if [ "$os_name" = "Linux" ] || [ "$os_name" = "Darwin" ]; then
207+
if [ "$os_name_arch" = "Linux x86_64" ] || [ "$os_name_arch" = "Darwin x86_64" ]; then
207208
reporter_filename="codacy-coverage-reporter"
208209
else
209210
reporter_filename="codacy-coverage-reporter-assembly.jar"
@@ -220,7 +221,7 @@ reporter_path="$reporter_folder"/"$reporter_filename"
220221

221222
download_reporter "$reporter_path" "$reporter_folder" "$reporter_filename"
222223

223-
if [ "$os_name" = "Linux" ] || [ "$os_name" = "Darwin" ]; then
224+
if [ "$os_name_arch" = "Linux x86_64" ] || [ "$os_name_arch" = "Darwin x86_64" ]; then
224225
chmod +x "$reporter_path"
225226
run_command="$reporter_path"
226227
else

0 commit comments

Comments
 (0)