Skip to content

Commit

Permalink
fix bug with terminal instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonwatson committed Sep 26, 2024
1 parent d9284f9 commit ddf8454
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tools/java/frc/tools/VerifyProfiling.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.SimpleFileVisitor;
import java.nio.file.StandardCopyOption;
import java.nio.file.StandardOpenOption;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.HashMap;
Expand Down Expand Up @@ -104,6 +106,8 @@ public void visitLabel(Label label) {
if (!reachedTerminal) {
current.goesTo.add(newCurrent);
newCurrent.comesFrom.add(current);
} else {
reachedTerminal = false;
}
current = newCurrent;
}
Expand Down Expand Up @@ -216,10 +220,10 @@ public void visitEnd() {
.replace(")", "_").replace("/", "_").replace(";", "_") + ".png");
try {
Files.createDirectories(p.getParent());
Files.write(p, sb.toString().getBytes());
Files.write(p, sb.toString().getBytes(), StandardOpenOption.CREATE);
var os = Runtime.getRuntime().exec("dot " + p.toString() + " -Tpng")
.getInputStream();
Files.copy(os, p2);
Files.copy(os, p2, StandardCopyOption.REPLACE_EXISTING);
} catch (IOException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit ddf8454

Please sign in to comment.