Skip to content

Commit

Permalink
add some logging for build script
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom-Ski committed Jan 18, 2024
1 parent 0a1100a commit 00e3231
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
4 changes: 2 additions & 2 deletions editor/src/com/talosvfx/talos/TALOS_BUILD.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ public final class TALOS_BUILD {
private static final String version = "2.0.0-SNAPSHOT";

@Getter
private static final String commit = "7085851";
private static final String commit = "0a1100a";

@Getter
private static final String branch = "talos-3d";

@Getter
private static final Date buildDate = new Date(1683799528613l);
private static final Date buildDate = new Date(1705408205407l);

private static void printHeader() {
System.out.println(" ___ ___ ___ ___ ___ \n"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,14 @@ public void onExport (ExportRequest event) {
}

if(!exportScript.isEmpty()) {
Toasts.getInstance().showInfoToast("Export script defined, trying to run");

FileHandle exportScriptHandle = settings.getExportScriptHandle();
String projectPath = currentProject.rootProjectDir().path();

if (exportScriptHandle.exists() && !exportScriptHandle.isDirectory()) {
Runtime rt = Runtime.getRuntime();
Toasts.getInstance().showInfoToast("Export script found in file system");

try {
String nodeCommand = "node";
Expand All @@ -109,6 +112,9 @@ public void onExport (ExportRequest event) {
if(!nodeBinary.exists()) {
nodeCommand = "/opt/homebrew/bin/node";
}

Toasts.getInstance().showInfoToast("Trying to launch build script runner for " + nodeCommand);

ProcessBuilder pb = new ProcessBuilder("bash", "-l", "-c", nodeCommand + " " + buildScriptPath + " " + projectDirectoryPath + " " + projectFilePathComm);
pb.inheritIO();
pb.start();
Expand All @@ -120,8 +126,13 @@ public void onExport (ExportRequest event) {
} catch (IOException e) {
e.printStackTrace();
logger.error("Error when running processor", e);
Toasts.getInstance().showErrorToast("Error when running processor " + e.getMessage());
}
} else {
Toasts.getInstance().showInfoToast("Export script not found in file system");
}
} else {
Toasts.getInstance().showInfoToast("No export script defined");
}
}
}

0 comments on commit 00e3231

Please sign in to comment.