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:
oriagranat9
2020-01-04 06:20:28 -08:00
committed by GitHub
parent 2ce8a8dad9
commit 159dea1e25
10 changed files with 278 additions and 9 deletions

View File

@@ -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() {

View File

@@ -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