Merge pull request #4655 from hgs-study/master

Added testing redis binary path for  Mac OS
pull/4657/head
Nikita Koksharov 2 years ago committed by GitHub
commit b5d2afa942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -9,13 +9,22 @@ import java.util.Locale;
public class RedissonRuntimeEnvironment {
public static final boolean isTravis = "true".equalsIgnoreCase(System.getProperty("travisEnv"));
public static final String redisBinaryPath = System.getProperty("redisBinary", "C:\\redis\\redis-server.exe");
public static final String redisBinaryPath = System.getProperty("redisBinary", installPathByOS());
public static final String tempDir = System.getProperty("java.io.tmpdir");
public static final String OS;
public static final boolean isWindows;
private static final String MAC_PATH = "/usr/local/opt/redis/bin/redis-server";
private static final String WINDOW_PATH = "C:\\redis\\redis-server.exe";
static {
OS = System.getProperty("os.name", "generic");
isWindows = OS.toLowerCase(Locale.ENGLISH).contains("win");
}
}
private static String installPathByOS(){
final String OS = System.getProperty("os.name", "generic");
final boolean isMacOS = OS.toLowerCase(Locale.ENGLISH).contains("mac");
return isMacOS ? MAC_PATH : WINDOW_PATH;
}
}
Loading…
Cancel
Save