From e3e5fdeeb35569f4b44e9cf45499d416e961b39f Mon Sep 17 00:00:00 2001 From: kstyrc Date: Mon, 16 Feb 2015 20:53:47 +0100 Subject: [PATCH] Middle work --- src/main/java/redis/embedded/RedisServer.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/redis/embedded/RedisServer.java b/src/main/java/redis/embedded/RedisServer.java index 87aaf725..1593ce23 100644 --- a/src/main/java/redis/embedded/RedisServer.java +++ b/src/main/java/redis/embedded/RedisServer.java @@ -3,6 +3,7 @@ import com.google.common.base.Strings; import com.google.common.io.Files; import redis.embedded.util.JarUtil; +import redis.embedded.util.OSDetector; import java.io.BufferedReader; import java.io.File; @@ -29,11 +30,14 @@ private RedisRunScriptEnum(String runScript) { } public static String getRedisRunScript() { - String osName = System.getProperty("os.name").toLowerCase(); - String osArch = System.getProperty("os.arch").toLowerCase(); + OSDetector.OS os = OSDetector.getOS(); + OSDetector.Architecture arch = OSDetector.getArchitecture(); - if (osName.contains("win")) { - if (osArch.contains("64")) { + switch (os) { + case + } + if (os == OSDetector.OS.WINDOWS) { + if (arch == OSDetector.Architecture.x86_64) { return WINDOWS_64.runScript; } else { return WINDOWS_32.runScript;