Fallback to the build command https://github.com/adbayb/termost/issues/28
This commit is contained in:
parent
d4f03b6b9e
commit
2ec22f07d5
@ -1,13 +1,14 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
|
|
||||||
import { termost } from "termost";
|
import { termost } from "termost";
|
||||||
|
import * as child_process from "child_process";
|
||||||
|
|
||||||
export type CliCommandOptions = {
|
export type CliCommandOptions = {
|
||||||
isSilent: boolean;
|
isSilent: boolean;
|
||||||
reactAppRootDirPath: string | undefined;
|
reactAppRootDirPath: string | undefined;
|
||||||
};
|
};
|
||||||
|
|
||||||
const program = termost<CliCommandOptions>("keycloakify");
|
const program = termost<CliCommandOptions>("Keycloak theme builder");
|
||||||
|
|
||||||
program
|
program
|
||||||
.option({
|
.option({
|
||||||
@ -77,7 +78,7 @@ program
|
|||||||
"description": [
|
"description": [
|
||||||
"Copy Keycloak default theme resources to the public directory.",
|
"Copy Keycloak default theme resources to the public directory.",
|
||||||
"This command is meant to be explicitly used in Webpack projects only."
|
"This command is meant to be explicitly used in Webpack projects only."
|
||||||
].join("\n")
|
].join(" ")
|
||||||
})
|
})
|
||||||
.task({
|
.task({
|
||||||
"handler": async cliCommandOptions => {
|
"handler": async cliCommandOptions => {
|
||||||
@ -85,3 +86,14 @@ program
|
|||||||
return command({ cliCommandOptions });
|
return command({ cliCommandOptions });
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Fallback to build command if no command is provided
|
||||||
|
{
|
||||||
|
const [, , ...rest] = process.argv;
|
||||||
|
|
||||||
|
if (rest.length === 0 || !rest[0].startsWith("-")) {
|
||||||
|
child_process.spawnSync("npx", ["keycloakify", "build", ...rest], {
|
||||||
|
"stdio": "inherit"
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -19,6 +19,7 @@ export type BuildOptions = {
|
|||||||
artifactId: string;
|
artifactId: string;
|
||||||
loginThemeResourcesFromKeycloakVersion: string;
|
loginThemeResourcesFromKeycloakVersion: string;
|
||||||
reactAppRootDirPath: string;
|
reactAppRootDirPath: string;
|
||||||
|
// TODO: Remove from vite type
|
||||||
reactAppBuildDirPath: string;
|
reactAppBuildDirPath: string;
|
||||||
/** Directory that keycloakify outputs to. Defaults to {cwd}/build_keycloak */
|
/** Directory that keycloakify outputs to. Defaults to {cwd}/build_keycloak */
|
||||||
keycloakifyBuildDirPath: string;
|
keycloakifyBuildDirPath: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user