From 0e420097980c1c6fda1d996223fcf6cf590d27c4 Mon Sep 17 00:00:00 2001 From: garronej Date: Thu, 16 Mar 2023 14:39:40 +0100 Subject: [PATCH] Fix bin test script --- src/test/bin/main.ts | 20 ++++++++++++-------- src/test/bin/setupSampleReactProject.ts | 4 ++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/test/bin/main.ts b/src/test/bin/main.ts index 630f90be..aa3f5b9c 100644 --- a/src/test/bin/main.ts +++ b/src/test/bin/main.ts @@ -4,14 +4,18 @@ import * as st from "scripting-tools"; import { join as pathJoin } from "path"; import { getProjectRoot } from "../../bin/tools/getProjectRoot.js"; -setupSampleReactProject(); +(async () => { + await setupSampleReactProject(); -const binDirPath = pathJoin(getProjectRoot(), "dist_test", "bin"); + const binDirPath = pathJoin(getProjectRoot(), "dist_test", "bin"); -st.execSyncTrace( - //`node ${pathJoin(binDirPath, "keycloakify")} --external-assets`, - `node ${pathJoin(binDirPath, "keycloakify")}`, - { "cwd": sampleReactProjectDirPath } -); + console.log("===>", binDirPath); -st.execSyncTrace(`node ${pathJoin(binDirPath, "download-builtin-keycloak-theme")}`, { "cwd": sampleReactProjectDirPath }); + st.execSyncTrace( + //`node ${pathJoin(binDirPath, "keycloakify")} --external-assets`, + `node ${pathJoin(binDirPath, "keycloakify")}`, + { "cwd": sampleReactProjectDirPath } + ); + + st.execSyncTrace(`node ${pathJoin(binDirPath, "download-builtin-keycloak-theme")}`, { "cwd": sampleReactProjectDirPath }); +})(); diff --git a/src/test/bin/setupSampleReactProject.ts b/src/test/bin/setupSampleReactProject.ts index 9c325c1d..6ccb5856 100644 --- a/src/test/bin/setupSampleReactProject.ts +++ b/src/test/bin/setupSampleReactProject.ts @@ -4,8 +4,8 @@ import { downloadAndUnzip } from "../../bin/tools/downloadAndUnzip"; export const sampleReactProjectDirPath = pathJoin(getProjectRoot(), "sample_react_project"); -export function setupSampleReactProject() { - downloadAndUnzip({ +export async function setupSampleReactProject() { + await downloadAndUnzip({ "url": "https://github.com/InseeFrLab/keycloakify/releases/download/v0.0.1/sample_build_dir_and_package_json.zip", "destDirPath": sampleReactProjectDirPath, "cacheDirPath": pathJoin(sampleReactProjectDirPath, "build_keycloak", ".cache"),