Skip to content

Commit

Permalink
We'll just use the raw artifacts from the Caffeinated CI.
Browse files Browse the repository at this point in the history
Much easier tbh.
  • Loading branch information
e3ndr committed Nov 1, 2024
1 parent a63f166 commit a06c134
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public List<String> supportedTargets() {

@Override
public String getDownloadName() {
return String.format("Linux-%s.tar.gz", Platform.archTarget);
return String.format("Casterlabs-Caffeinated-gnulinux-%s.tar.gz", Platform.archTarget);
}

@Override
Expand All @@ -44,8 +44,7 @@ public File getUpdaterLaunchFile() {

@Override
public void finalizeUpdate(UpdaterDialog dialog, File appDirectory) throws InterruptedException, IOException {
new File(appDirectory, "Casterlabs-Caffeinated").setExecutable(true);
new File(appDirectory, "runtime/bin/java").setExecutable(true);
// NOOP
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public List<String> supportedTargets() {

@Override
public String getDownloadName() {
return String.format("macOS-%s.tar.gz", Platform.archTarget);
return String.format("Casterlabs-Caffeinated-macos-%s.tar.gz", Platform.archTarget);
}

@Override
Expand All @@ -45,27 +45,22 @@ public File getUpdaterLaunchFile() {

@Override
public void finalizeUpdate(UpdaterDialog dialog, File appDirectory) throws InterruptedException, IOException {
if (Platform.osDistribution == OSDistribution.MACOS) {
// Unquarantine the app on MacOS.
String app = '"' + new File(appDirectory, "Casterlabs-Caffeinated.app").getAbsolutePath() + '"';
String command = "xattr -rd com.apple.quarantine " + app;
// Unquarantine the app on MacOS.
String app = '"' + new File(appDirectory, "Casterlabs-Caffeinated.app").getAbsolutePath() + '"';
String command = "xattr -rd com.apple.quarantine " + app;

dialog.setStatus("Waiting for permission...");
FastLogger.logStatic("Trying to unquarantine the app...");
dialog.setStatus("Waiting for permission...");
FastLogger.logStatic("Trying to unquarantine the app...");

new ProcessBuilder()
.command(
"osascript",
"-e",
"do shell script \"" + command.replace("\"", "\\\"") + "\" with prompt \"Casterlabs Caffeinated would like to make changes.\" with administrator privileges"
)
.inheritIO()
.start()
.waitFor();
}

new File(appDirectory, "Casterlabs-Caffeinated.app/Contents/MacOS/Casterlabs-Caffeinated").setExecutable(true);
new File(appDirectory, "Casterlabs-Caffeinated.app/Contents/Resources/runtime/bin/java").setExecutable(true);
new ProcessBuilder()
.command(
"osascript",
"-e",
"do shell script \"" + command.replace("\"", "\\\"") + "\" with prompt \"Casterlabs Caffeinated would like to make changes.\" with administrator privileges"
)
.inheritIO()
.start()
.waitFor();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public List<String> supportedTargets() {

@Override
public String getDownloadName() {
return "Windows-x86_64.zip";
return "Casterlabs-Caffeinated-windows-x86_64.zip";
}

@Override
Expand Down

0 comments on commit a06c134

Please sign in to comment.