The first commit, the core and all files is adding to repo
This commit is contained in:
24
scripts/java-build.mjs
Normal file
24
scripts/java-build.mjs
Normal file
@@ -0,0 +1,24 @@
|
||||
import { spawn } from "node:child_process";
|
||||
import { existsSync } from "node:fs";
|
||||
import { mkdir, copyFile } from "node:fs/promises";
|
||||
const windows = process.platform === "win32";
|
||||
const command = windows ? "gradlew.bat" : "./gradlew";
|
||||
const targets = process.argv.slice(2);
|
||||
if (!targets.length) targets.push(":plugin:build", ":fabric:build");
|
||||
await new Promise((resolve, reject) => {
|
||||
const child = spawn(command, targets, {
|
||||
cwd: "minecraft",
|
||||
stdio: "inherit",
|
||||
shell: windows,
|
||||
});
|
||||
child.on("error", reject);
|
||||
child.on("exit", (code) =>
|
||||
code === 0 ? resolve() : reject(new Error(`Gradle exited ${code}`)),
|
||||
);
|
||||
});
|
||||
await mkdir("public/downloads", { recursive: true });
|
||||
for (const name of ["plugin", "fabric"]) {
|
||||
const file = `minegeo-${name}-1.21.11.jar`,
|
||||
path = `minecraft/${name}/build/libs/${file}`;
|
||||
if (existsSync(path)) await copyFile(path, `public/downloads/${file}`);
|
||||
}
|
||||
Reference in New Issue
Block a user