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

38 lines
1.3 KiB
TypeScript
Raw Normal View History

import { join as pathJoin, relative as pathRelative, sep as pathSep } from "path";
import { promptKeycloakVersion } from "./shared/promptKeycloakVersion";
import { readBuildOptions } from "./shared/buildOptions";
import { downloadBuiltinKeycloakTheme } from "./shared/downloadBuiltinKeycloakTheme";
import type { CliCommandOptions } from "./main";
import chalk from "chalk";
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(chalk.cyan("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
});
console.log(`${keycloakVersion}`);
const destDirPath = pathJoin(buildOptions.keycloakifyBuildDirPath, "src", "main", "resources", "theme");
console.log(
`Downloading builtins theme of Keycloak ${keycloakVersion} here ${chalk.bold(`.${pathSep}${pathRelative(process.cwd(), destDirPath)}`)}`
);
await downloadBuiltinKeycloakTheme({
keycloakVersion,
2023-09-03 23:26:34 +02:00
destDirPath,
buildOptions
});
console.log(chalk.green(`✓ done`));
}