Permissions and filesystems #9
@ -142,20 +142,18 @@ public class Main {
|
|||||||
Values.printError(e, "(while initializing TS)");
|
Values.printError(e, "(while initializing TS)");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
private static void initReader() {
|
|
||||||
|
public static void main(String args[]) {
|
||||||
|
System.out.println(String.format("Running %s v%s by %s", Metadata.name(), Metadata.version(), Metadata.author()));
|
||||||
|
|
||||||
|
Main.args = args;
|
||||||
var reader = new Thread(Main::reader);
|
var reader = new Thread(Main::reader);
|
||||||
|
|
||||||
|
initEnv();
|
||||||
|
initEngine();
|
||||||
|
|
||||||
reader.setDaemon(true);
|
reader.setDaemon(true);
|
||||||
reader.setName("STD Reader");
|
reader.setName("STD Reader");
|
||||||
reader.start();
|
reader.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String args[]) {
|
|
||||||
System.out.println(String.format("Running %s v%s by %s", Metadata.NAME, Metadata.VERSION, Metadata.AUTHOR));
|
|
||||||
|
|
||||||
Main.args = args;
|
|
||||||
|
|
||||||
initEnv();
|
|
||||||
initEngine();
|
|
||||||
initReader();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,20 @@
|
|||||||
package me.topchetoeu.jscript;
|
package me.topchetoeu.jscript;
|
||||||
|
|
||||||
public class Metadata {
|
public class Metadata {
|
||||||
public static final String VERSION = "${VERSION}";
|
private static final String VERSION = "${VERSION}";
|
||||||
public static final String AUTHOR = "${AUTHOR}";
|
private static final String AUTHOR = "${AUTHOR}";
|
||||||
public static final String NAME = "${NAME}";
|
private static final String NAME = "${NAME}";
|
||||||
|
|
||||||
|
public static String version() {
|
||||||
|
if (VERSION.equals("$" + "{VERSION}")) return "1337-devel";
|
||||||
|
else return VERSION;
|
||||||
|
}
|
||||||
|
public static String author() {
|
||||||
|
if (AUTHOR.equals("$" + "{AUTHOR}")) return "anonymous";
|
||||||
|
else return AUTHOR;
|
||||||
|
}
|
||||||
|
public static String name() {
|
||||||
|
if (NAME.equals("$" + "{NAME}")) return "some-product";
|
||||||
|
else return NAME;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ import me.topchetoeu.jscript.json.JSONList;
|
|||||||
import me.topchetoeu.jscript.json.JSONMap;
|
import me.topchetoeu.jscript.json.JSONMap;
|
||||||
|
|
||||||
public class DebugServer {
|
public class DebugServer {
|
||||||
public static String browserDisplayName = Metadata.NAME + "/" + Metadata.VERSION;
|
public static String browserDisplayName = Metadata.name() + "/" + Metadata.version();
|
||||||
|
|
||||||
public final HashMap<String, DebuggerProvider> targets = new HashMap<>();
|
public final HashMap<String, DebuggerProvider> targets = new HashMap<>();
|
||||||
|
|
||||||
@ -236,9 +236,9 @@ public class DebugServer {
|
|||||||
this.protocol = getClass().getClassLoader().getResourceAsStream("assets/protocol.json").readAllBytes();
|
this.protocol = getClass().getClassLoader().getResourceAsStream("assets/protocol.json").readAllBytes();
|
||||||
var index = new String(getClass().getClassLoader().getResourceAsStream("assets/index.html").readAllBytes());
|
var index = new String(getClass().getClassLoader().getResourceAsStream("assets/index.html").readAllBytes());
|
||||||
this.index = index
|
this.index = index
|
||||||
.replace("${NAME}", Metadata.NAME)
|
.replace("${NAME}", Metadata.name())
|
||||||
.replace("${VERSION}", Metadata.VERSION)
|
.replace("${VERSION}", Metadata.version())
|
||||||
.replace("${AUTHOR}", Metadata.AUTHOR)
|
.replace("${AUTHOR}", Metadata.author())
|
||||||
.getBytes();
|
.getBytes();
|
||||||
}
|
}
|
||||||
catch (IOException e) { throw new UncheckedIOException(e); }
|
catch (IOException e) { throw new UncheckedIOException(e); }
|
||||||
|
Loading…
Reference in New Issue
Block a user