From fb8efac1ab8b72b16a017dd6d4fe542ed6e946c2 Mon Sep 17 00:00:00 2001 From: nomo-fe Date: Sat, 9 Dec 2023 14:40:21 +0100 Subject: [PATCH] add a usable developer-instruction if the assetDir is not named out --- src/build-webon/build-webon.ts | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/build-webon/build-webon.ts b/src/build-webon/build-webon.ts index 99c158c..1052798 100644 --- a/src/build-webon/build-webon.ts +++ b/src/build-webon/build-webon.ts @@ -36,17 +36,21 @@ export async function deleteExistingTarFile( } export async function buildWebOn(assetDir: string): Promise { - const isOutDir = assetDir.endsWith("/out"); - const outDirPath = isOutDir ? assetDir : path.resolve(assetDir, "..", "out"); - checkDir(assetDir); - //renameAssetDir(assetDir); - // if (!isOutDir) { - // console.log("Directories are already named correctly, no need to rename."); - // } + // path.basename word for both Linux and Windows + const isOutDir = path.basename(assetDir) === "out"; + const outDirPath = isOutDir ? assetDir : path.resolve(assetDir, "..", "out"); - // createOutDir(outDirPath); + if (!isOutDir) { + logFatal( + "The assetDir must be named 'out'. If needed, please add a mv-command to your build-script for renaming " + + getDebugPath(assetDir) + + " into " + + getDebugPath(outDirPath) + + "." + ); + } const missingFiles = checkRequiredFiles(outDirPath);