Skip to content

Commit

Permalink
removing prints
Browse files Browse the repository at this point in the history
  • Loading branch information
madhephaestus committed Oct 27, 2024
1 parent 8878aca commit c2bb359
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 22 deletions.
12 changes: 6 additions & 6 deletions lib/src/main/java/com/commonwealthrobotics/HatRackMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
public class HatRackMain {

public static void main(String[] args) {
System.out.println("Hello World!");
for(int i=0;i<args.length;i++) {
System.out.println("Arg "+i+" = "+args[i]);
}
System.out.println(System.getProperty("os.name"));
System.out.println(System.getProperty("os.arch"));
// com.neuronrobotics.sdk.common.Log.error("Hello World!");
// for(int i=0;i<args.length;i++) {
// com.neuronrobotics.sdk.common.Log.error("Arg "+i+" = "+args[i]);
// }
// com.neuronrobotics.sdk.common.Log.error(System.getProperty("os.name"));
// com.neuronrobotics.sdk.common.Log.error(System.getProperty("os.arch"));

}

Expand Down
18 changes: 9 additions & 9 deletions lib/src/main/java/com/commonwealthrobotics/JvmManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static String getCommandString(String project, String repo, String versio
try {
unzip(jvmArchive, bindir);
}catch(java.util.zip.ZipException ex) {
System.out.println("Failed the extract, erasing and re-downloading");
//System.out.println("Failed the extract, erasing and re-downloading");
jvmArchive.delete();
ex.printStackTrace();
return getCommandString(project, repo, version, downloadJsonURL,
Expand All @@ -92,7 +92,7 @@ public static String getCommandString(String project, String repo, String versio
untar(jvmArchive, bindir);
}
} else {
System.out.println("Not extraction, VM exists " + dest.getAbsolutePath());
//System.out.println("Not extraction, VM exists " + dest.getAbsolutePath());
}
String cmd = bindir + name + "/bin/java" + (LatestFromGithubLaunchUI.isWin() ? ".exe" : "") + " ";
for (String s : jvmargs) {
Expand Down Expand Up @@ -156,7 +156,7 @@ private static void unzip(File path, String dir) throws Exception {
String text = new BufferedReader(new InputStreamReader(in, StandardCharsets.UTF_8))
.lines().collect(Collectors.joining("\n"));
Path target = Paths.get(".", text);
System.out.println("Creating symlink " + entryPath + " with " + target);
//System.out.println("Creating symlink " + entryPath + " with " + target);

Files.createSymbolicLink(entryPath, target);
continue;
Expand Down Expand Up @@ -188,7 +188,7 @@ private static void untar(File tarFile, String dir) throws Exception {
// tarIn is a TarArchiveInputStream
while (tarEntry != null) {// create a file with the same name as the tarEntry
File destPath = new File(dest.toString() + System.getProperty("file.separator") + tarEntry.getName());
// System.out.println("working: " + destPath.getCanonicalPath());
// //System.out.println("working: " + destPath.getCanonicalPath());
if (tarEntry.isDirectory()) {
destPath.mkdirs();
} else {
Expand Down Expand Up @@ -226,15 +226,15 @@ private static File download(String version, String downloadJsonURL, long sizeOf
pis.addListener(new Listener() {
@Override
public void process(double percent) {
//System.out.println("Download percent " + percent);
////System.out.println("Download percent " + percent);
Platform.runLater(() -> {
progress.setProgress(percent);
});
}
});

if (!folder.exists() || !exe.exists()) {
System.out.println("Start Downloading " + filename);
//System.out.println("Start Downloading " + filename);
folder.mkdirs();
exe.createNewFile();
byte dataBuffer[] = new byte[1024];
Expand All @@ -245,14 +245,14 @@ public void process(double percent) {
}
fileOutputStream.close();
pis.close();
System.out.println("Finished downloading " + filename);
//System.out.println("Finished downloading " + filename);
} else {
System.out.println("Not downloadeing, it existst " + filename);
//System.out.println("Not downloadeing, it existst " + filename);
}
} catch (Throwable t) {
t.printStackTrace();
}
System.out.println("Using JVM "+exe.getAbsolutePath());
//System.out.println("Using JVM "+exe.getAbsolutePath());
return exe;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ public class LatestFromGithubLaunchUI {

@FXML
void onNo(ActionEvent event) {
System.out.println("No path");
//System.out.println("No path");
launchApplication();
}

@FXML
void onYes(ActionEvent event) {
System.out.println("Yes path");
//System.out.println("Yes path");
yesButton.setDisable(true);
noButton.setDisable(true);
new Thread(() -> {
Expand Down Expand Up @@ -194,14 +194,14 @@ public void launchApplication() {
}

String finalCommand=fc;
System.out.println("Running:\n\n"+finalCommand+"\n\n");
//System.out.println("Running:\n\n"+finalCommand+"\n\n");
new Thread(() -> {
try {
Process process = Runtime.getRuntime().exec(finalCommand);
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getErrorStream()));
String line;
while ((line = reader.readLine()) != null && process.isAlive()) {
System.out.println(line);
//System.out.println(line);
try {
Thread.sleep(10);
} catch (InterruptedException e) {
Expand All @@ -210,7 +210,7 @@ public void launchApplication() {
}
}
reader.close();
System.out.println("LatestFromGithubLaunch clean exit");
//System.out.println("LatestFromGithubLaunch clean exit");
System.exit(0);
} catch (IOException e) {
// TODO Auto-generated catch block
Expand Down Expand Up @@ -261,12 +261,12 @@ public static void readCurrentVersion(String url) throws IOException {
if (((String) key.get("name")).contentEquals(jarName)) {
downloadJarURL = (String) key.get("browser_download_url");
sizeOfJar = ((Double) key.get("size")).longValue();
System.out.println(downloadJarURL + " Size " + sizeOfJar + " bytes");
//System.out.println(downloadJarURL + " Size " + sizeOfJar + " bytes");
}
if (((String) key.get("name")).contentEquals("jvm.json")) {
downloadJsonURL = (String) key.get("browser_download_url");
sizeOfJson = ((Double) key.get("size")).longValue();
System.out.println(downloadJsonURL + " Size " + sizeOfJson + " bytes");
//System.out.println(downloadJsonURL + " Size " + sizeOfJson + " bytes");
}

}
Expand Down

0 comments on commit c2bb359

Please sign in to comment.