Skip to content

Commit

Permalink
#41 Add host to the environment
Browse files Browse the repository at this point in the history
  • Loading branch information
ME1312 committed May 2, 2019
1 parent 7761835 commit 4923b71
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
Expand Up @@ -87,6 +87,7 @@ private ObjectMap<String> build(File dir, ServerTemplate template, List<ServerTe
System.out.println(name + File.separator + "Creator > Loading Template: " + template.getDisplayName());
Util.copyDirectory(template.getDirectory(), dir);
var.put("name", name);
var.put("host", host.getName());
var.put("template", template.getName());
var.put("type", template.getType().toString().toUpperCase());
if (version != null) var.put("version", version.toString());
Expand Down
Expand Up @@ -121,6 +121,7 @@ private void run() {
try {
ProcessBuilder pb = new ProcessBuilder().command(Executable.parse(host.getCreator().getBashDirectory(), executable)).directory(directory);
pb.environment().put("name", getName());
pb.environment().put("host", host.getName());
pb.environment().put("address", host.getAddress().getHostAddress());
pb.environment().put("port", Integer.toString(getAddress().getPort()));
process = pb.start();
Expand Down
Expand Up @@ -232,6 +232,7 @@ private YAMLSection build(File dir, ServerTemplate template, List<ServerTemplate
host.subdata.sendPacket(new PacketOutExLogMessage(address, "Loading Template: " + template.getDisplayName()));
Util.copyDirectory(template.getDirectory(), dir);
var.put("name", name);
if (host.subdata != null) var.put("host", host.subdata.getName());
var.put("template", template.getName());
var.put("type", template.getType().toString().toUpperCase());
var.put("version", version.toString());
Expand Down
Expand Up @@ -110,6 +110,7 @@ private void run() {
try {
ProcessBuilder pb = new ProcessBuilder().command(Executable.parse(host.host.getRawString("Git-Bash"), executable)).directory(directory);
pb.environment().put("name", getName());
if (host.subdata != null) pb.environment().put("host", host.subdata.getName());
pb.environment().put("address", host.config.get().getSection("Settings").getRawString("Server-Bind"));
pb.environment().put("port", Integer.toString(getPort()));
process = pb.start();
Expand Down

0 comments on commit 4923b71

Please sign in to comment.