mirror of
https://github.com/ME1312/SubServers-2.git
synced 2024-11-22 02:08:27 +01:00
Allow build scripts to reference a template's source files
This commit is contained in:
parent
dfabbcf4ad
commit
ff709ba314
@ -178,17 +178,13 @@ public class InternalSubCreator extends SubCreator {
|
||||
}
|
||||
|
||||
if (template.getBuildOptions().contains("Executable")) {
|
||||
File cache;
|
||||
File cache = null;
|
||||
if (template.getBuildOptions().getBoolean("Use-Cache", true)) {
|
||||
cache = new UniversalFile(host.plugin.dir, "SubServers:Cache:Templates:" + template.getName());
|
||||
cache.mkdirs();
|
||||
String c = cache.toString();
|
||||
if (System.getProperty("os.name").toLowerCase().startsWith("windows") &&
|
||||
(template.getBuildOptions().getRawString("Executable").toLowerCase().startsWith("bash ") || template.getBuildOptions().getRawString("Executable").toLowerCase().startsWith("sh "))) c = c.replace(File.separatorChar, '/');
|
||||
var.put("cache", c);
|
||||
} else {
|
||||
cache = null;
|
||||
var.put("cache", cache.getAbsolutePath());
|
||||
}
|
||||
var.put("source", dir.getAbsolutePath());
|
||||
|
||||
try {
|
||||
Logger.get(prefix).info("Launching Build Script...");
|
||||
|
@ -378,17 +378,13 @@ public class SubCreatorImpl {
|
||||
}
|
||||
|
||||
if (template.getBuildOptions().contains("Executable")) {
|
||||
File cache;
|
||||
File cache = null;
|
||||
if (template.getBuildOptions().getBoolean("Use-Cache", true)) {
|
||||
cache = new UniversalFile(GalaxiEngine.getInstance().getRuntimeDirectory(), "Cache:Templates:" + template.getName());
|
||||
cache.mkdirs();
|
||||
String c = cache.toString();
|
||||
if (System.getProperty("os.name").toLowerCase().startsWith("windows") &&
|
||||
(template.getBuildOptions().getRawString("Executable").toLowerCase().startsWith("bash ") || template.getBuildOptions().getRawString("Executable").toLowerCase().startsWith("sh "))) c = c.replace(File.separatorChar, '/');
|
||||
var.put("cache", c);
|
||||
} else {
|
||||
cache = null;
|
||||
var.put("cache", cache.getAbsolutePath());
|
||||
}
|
||||
var.put("source", dir.getAbsolutePath());
|
||||
|
||||
try {
|
||||
log.logger.info.println("Launching Build Script...");
|
||||
|
Loading…
Reference in New Issue
Block a user