keycloak_theme/src/bin/download-builtin-keycloak-theme.ts

31 lines
1.1 KiB
TypeScript
Raw Normal View History

2021-03-03 02:31:02 +01:00
import { join as pathJoin } from "path";
import { promptKeycloakVersion } from "./shared/promptKeycloakVersion";
import { readBuildOptions } from "./shared/buildOptions";
import { downloadBuiltinKeycloakTheme } from "./shared/downloadBuiltinKeycloakTheme";
import type { CliCommandOptions } from "./main";
2021-02-21 23:06:42 +01:00
export async function command(params: { cliCommandOptions: CliCommandOptions }) {
const { cliCommandOptions } = params;
2023-09-03 23:26:34 +02:00
const buildOptions = readBuildOptions({
cliCommandOptions
});
console.log("Select the Keycloak version from which you want to download the builtins theme:");
2024-05-17 05:13:41 +02:00
const { keycloakVersion } = await promptKeycloakVersion({
"startingFromMajor": undefined,
"cacheDirPath": buildOptions.cacheDirPath
2024-05-17 05:13:41 +02:00
});
const destDirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme");
2024-05-18 10:24:55 +02:00
console.log(`Downloading builtins theme of Keycloak ${keycloakVersion} here ${destDirPath}`);
await downloadBuiltinKeycloakTheme({
keycloakVersion,
2023-09-03 23:26:34 +02:00
destDirPath,
buildOptions
});
}