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

Resolve issue with Embedded Redis not running after MacOS Sonoma update #138

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ Contributors
* Artem Orobets ([@enisher](http://github.com/enisher))
* Sean Simonsen ([@SeanSimonsen](http://github.com/SeanSimonsen))
* Rob Winch ([@rwinch](http://github.com/rwinch))
* JongBeom Lee ([@devleejb](http://github.com/devleejb))


Changelog
Expand Down
16 changes: 7 additions & 9 deletions src/main/java/redis/embedded/RedisExecProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
import java.util.Map;

public class RedisExecProvider {

private final Map<OsArchitecture, String> executables = Maps.newHashMap();

public static RedisExecProvider defaultProvider() {
return new RedisExecProvider();
}

private RedisExecProvider() {
initExecutables();
}
Expand All @@ -30,8 +30,8 @@ private void initExecutables() {
executables.put(OsArchitecture.UNIX_x86, "redis-server-2.8.19-32");
executables.put(OsArchitecture.UNIX_x86_64, "redis-server-2.8.19");

executables.put(OsArchitecture.MAC_OS_X_x86, "redis-server-2.8.19.app");
executables.put(OsArchitecture.MAC_OS_X_x86_64, "redis-server-2.8.19.app");
executables.put(OsArchitecture.MAC_OS_X_x86, "redis-server-2.8.19-mac");
executables.put(OsArchitecture.MAC_OS_X_x86_64, "redis-server-2.8.19-mac");
}

public RedisExecProvider override(OS os, String executable) {
Expand All @@ -47,14 +47,12 @@ public RedisExecProvider override(OS os, Architecture arch, String executable) {
executables.put(new OsArchitecture(os, arch), executable);
return this;
}

public File get() throws IOException {
OsArchitecture osArch = OsArchitecture.detect();
String executablePath = executables.get(osArch);
return fileExists(executablePath) ?
new File(executablePath) :
JarUtil.extractExecutableFromJar(executablePath);

return fileExists(executablePath) ? new File(executablePath) : JarUtil.extractExecutableFromJar(executablePath);

}

private boolean fileExists(String executablePath) {
Expand Down