Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ARM Support in NodeManager #284

Merged
merged 1 commit into from Jul 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -43,6 +43,7 @@ public interface Constants {
public static final String TEST_RESOURCES_DIR = "src/test/resources";

public static final String NODE_VERSION = "0.10.29";
public static final String NODE_VERSION_ARM = "0.10.26";
public static final String NPM_VERSION = "1.4.12";

public static final String INSTRUCTIONS_FILE = "src/main/osgi/osgi.bnd";
Expand Down
Expand Up @@ -164,13 +164,16 @@ private void downloadAndInstallNode() throws IOException {
".tar.gz");
}
} else if (ExecUtils.isLinux()) {
if (!ExecUtils.is64bit()) {
path = "node-v" + Constants.NODE_VERSION + "-linux-x86";
url = new URL(NODE_DIST + Constants.NODE_VERSION + "/node-v" + Constants.NODE_VERSION + "-linux-x86.tar.gz");
} else {
path = "node-v" + Constants.NODE_VERSION + "-linux-x64";
url = new URL(NODE_DIST + Constants.NODE_VERSION + "/node-v" + Constants.NODE_VERSION + "-linux-x64.tar.gz");
}
if(ExecUtils.isARM()){
path = "node-v" + Constants.NODE_VERSION_ARM + "-linux-arm-pi";
url = new URL(NODE_DIST + Constants.NODE_VERSION_ARM + "/node-v" + Constants.NODE_VERSION_ARM + "-linux-arm-pi.tar.gz");
}else if (ExecUtils.is64bit()) {
path = "node-v" + Constants.NODE_VERSION + "-linux-x64";
url = new URL(NODE_DIST + Constants.NODE_VERSION + "/node-v" + Constants.NODE_VERSION + "-linux-x64.tar.gz");
} else {
path = "node-v" + Constants.NODE_VERSION + "-linux-x86";
url = new URL(NODE_DIST + Constants.NODE_VERSION + "/node-v" + Constants.NODE_VERSION + "-linux-x86.tar.gz");
}
} else {
throw new UnsupportedOperationException("Operating system `" + System.getProperty("os.name") + "` not " +
"supported");
Expand Down
Expand Up @@ -90,5 +90,8 @@ public static boolean is64bit() {
return arch != null && arch.contains("64");
}


public static boolean isARM(){
final String arch = System.getProperty("os.arch");
return arch != null && arch.contains("arm");
}
}