From 5d02a6fc94537c5def03aae22e1c05a1eaaf6516 Mon Sep 17 00:00:00 2001 From: codelano Date: Thu, 25 Apr 2019 14:47:43 +0300 Subject: [PATCH] Added support for Rasbian OS armv7l architecture Currently, when using install-node-and-npm on Rasbian OS, it resolves it as x86 arch, which is not correct and it's unable to donwload it from https://nodejs.org/dist/{node.version}/node-{node.version}-linux-{os.arch}.tar.gz. This change, allows for Rasbian env to resolve proper archive name. Compiled and tested on Rasbian with RPI 3B+ --- .../eirslett/maven/plugins/frontend/lib/Platform.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/Platform.java b/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/Platform.java index ce7b808a9..aa39f59e3 100644 --- a/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/Platform.java +++ b/frontend-plugin-core/src/main/java/com/github/eirslett/maven/plugins/frontend/lib/Platform.java @@ -1,14 +1,18 @@ package com.github.eirslett.maven.plugins.frontend.lib; -enum Architecture { x86, x64, ppc64le, s390x, arm64; +enum Architecture { x86, x64, ppc64le, s390x, arm64, armv7l; public static Architecture guess(){ String arch = System.getProperty("os.arch"); + String version = System.getProperty("os.version"); + if (arch.equals("ppc64le")) { return ppc64le; } else if (arch.equals("aarch64")) { return arm64; } else if (arch.equals("s390x")) { return s390x; + } else if (arch.equals("arm") && version.contains("v7")) { + return armv7l; } else { return arch.contains("64") ? x64 : x86; }