[EXPAND] [[messages]] messageTitle = "QB Update for GT 2.8 (#681)" messageBody = """ [QB] [DETAILS] details = ["Fixes many Quest Book issues", "Updates QB with changes in GT 2.8"] [DETAILS] """ [[messages]] messageTitle = "Buildscript Refactor (#681)" messageBody = """ [INTERNAL] [DETAILS] details = ["**Important: Buildscript has changed from `npx gulp...` or `gulp...` to `npm run gulp...`**!", "Moves to Node 16 Package Management + Typescript Strict Mode", "New Port QB, Check QB and Fix QB Tasks"] [DETAILS] """ [EXPAND] Co-authored-by: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Co-authored-by: Ghzdude <44148655+ghzdude@users.noreply.github.com> Co-authored-by: SparkedTheorem <162088357+SparkedTheorem@users.noreply.github.com>
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import gulp from "gulp";
|
|
import rename from "gulp-rename";
|
|
import merge from "merge-stream";
|
|
import upath from "upath";
|
|
import buildConfig from "#buildConfig";
|
|
import {
|
|
langDestDirectory,
|
|
overridesFolder,
|
|
sharedDestDirectory,
|
|
} from "#globals";
|
|
import fs from "fs";
|
|
|
|
/**
|
|
* Checks and creates all necessary directories so we can build the lang safely.
|
|
*/
|
|
async function createLangDirs() {
|
|
if (!fs.existsSync(langDestDirectory)) {
|
|
await fs.promises.mkdir(langDestDirectory, { recursive: true });
|
|
}
|
|
}
|
|
|
|
async function copyLang() {
|
|
const resourcesPath = upath.join(
|
|
sharedDestDirectory,
|
|
overridesFolder,
|
|
"resources",
|
|
);
|
|
|
|
const opts = { base: resourcesPath, resolveSymlinks: true };
|
|
const streams = [
|
|
gulp.src(upath.join(resourcesPath, "pack.mcmeta"), opts),
|
|
gulp.src(upath.join(resourcesPath, "**/*.lang"), opts).pipe(
|
|
rename((f) => {
|
|
f.dirname = upath.join("assets", f.dirname);
|
|
}),
|
|
),
|
|
];
|
|
|
|
return await new Promise((resolve) => {
|
|
merge(...streams)
|
|
.pipe(
|
|
gulp.dest(
|
|
upath.join(buildConfig.buildDestinationDirectory, langDestDirectory),
|
|
),
|
|
)
|
|
.on("end", resolve);
|
|
});
|
|
}
|
|
|
|
export default gulp.series(createLangDirs, copyLang);
|