fix update scripts to tor 0.4.8.9 mac
continuous-integration/drone/pr Build is passing Details
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Dan Ballard 2023-11-29 12:08:06 -08:00
parent e3f0f66445
commit c09f10b650
1 changed files with 10 additions and 10 deletions

View File

@ -199,22 +199,22 @@ class CwtchFfi implements Cwtch {
}
} else if (Platform.isMacOS) {
cwtchDir = envVars['CWTCH_HOME'] ?? path.join(envVars['HOME']!, "Library/Application Support/Cwtch");
if (await File("Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) {
bundledTor = "Cwtch.app/Contents/MacOS/Tor/tor.real";
} else if (await File("/Applications/Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) {
bundledTor = "/Applications/Cwtch.app/Contents/MacOS/Tor/tor.real";
} else if (await File("/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real").exists()) {
bundledTor = "/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor.real";
} else if (await File("/Applications/Tor Browser.app/Contents/MacOS/Tor/tor.real").exists()) {
bundledTor = "/Applications/Tor Browser.app/Contents/MacOS/Tor/tor.real";
if (await File("Cwtch.app/Contents/MacOS/Tor/tor").exists()) {
bundledTor = "Cwtch.app/Contents/MacOS/Tor/tor";
} else if (await File("/Applications/Cwtch.app/Contents/MacOS/Tor/tor").exists()) {
bundledTor = "/Applications/Cwtch.app/Contents/MacOS/Tor/tor";
} else if (await File("/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor").exists()) {
bundledTor = "/Volumes/Cwtch/Cwtch.app/Contents/MacOS/Tor/tor";
} else if (await File("/Applications/Tor Browser.app/Contents/MacOS/Tor/tor").exists()) {
bundledTor = "/Applications/Tor Browser.app/Contents/MacOS/Tor/tor";
print("We couldn't find Tor in the Cwtch app directory, however we can fall back to the Tor Browser binary");
} else {
var splitPath = path.split(dirname(Platform.script.path));
if (splitPath[0] == "/" && splitPath[1] == "Applications") {
var appName = splitPath[2];
print("We're running in /Applications in a non standard app name: $appName");
if (await File("/Applications/$appName/Contents/MacOS/Tor/tor.real").exists()) {
bundledTor = "/Applications/$appName/Contents/MacOS/Tor/tor.real";
if (await File("/Applications/$appName/Contents/MacOS/Tor/tor").exists()) {
bundledTor = "/Applications/$appName/Contents/MacOS/Tor/tor";
}
}
}