mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
Event scripts (#36)
* Begin scripting work * More scripting work * Finalize scripting system * Begin implementing script events * Finalize script system Co-authored-by: Banks T <btrout.dhrs@gmail.com>
This commit is contained in:
@@ -23,7 +23,7 @@ public enum Platform {
|
||||
private static final String OS_ARCH = System.getProperty("os.arch");
|
||||
public static final Platform CurrentPlatform = getCurrentPlatform();
|
||||
|
||||
public boolean isWindows() {
|
||||
public boolean isWindows() {
|
||||
return this == WINDOWS_64;
|
||||
}
|
||||
|
||||
@@ -35,6 +35,10 @@ public enum Platform {
|
||||
return this == MACOS_64;
|
||||
}
|
||||
|
||||
public static boolean isRaspberryPi() {
|
||||
return CurrentPlatform.equals(LINUX_RASPBIAN);
|
||||
}
|
||||
|
||||
private static ShellExec shell = new ShellExec(true, false);
|
||||
|
||||
public boolean isRoot() {
|
||||
|
||||
@@ -24,19 +24,16 @@ public class ProgramDirectoryUtilities
|
||||
{
|
||||
if (runningFromJAR())
|
||||
{
|
||||
if (Platform.isRaspberryPi()) {
|
||||
return "/boot/chameleon-vision";
|
||||
}
|
||||
return getCurrentJARDirectory();
|
||||
} else
|
||||
{
|
||||
return System.getProperty("user.dir");
|
||||
// return getCurrentProjectDirectory();
|
||||
}
|
||||
}
|
||||
|
||||
private static String getCurrentProjectDirectory()
|
||||
{
|
||||
return new File("").getAbsolutePath();
|
||||
}
|
||||
|
||||
private static String getCurrentJARDirectory()
|
||||
{
|
||||
try
|
||||
|
||||
Reference in New Issue
Block a user