Compare commits

..

7 Commits

6 changed files with 8 additions and 40 deletions

View File

@ -1,6 +1,6 @@
{
"name": "keycloakify",
"version": "6.8.10",
"version": "6.8.12",
"description": "Keycloak theme generator for Reacts app",
"repository": {
"type": "git",

View File

@ -4,7 +4,6 @@ import { join as pathJoin, relative as pathRelative, dirname as pathDirname } fr
import { crawl } from "./tools/crawl";
import { downloadBuiltinKeycloakTheme } from "./download-builtin-keycloak-theme";
import { getProjectRoot } from "./tools/getProjectRoot";
import { rm_rf, rm_r } from "./tools/rm";
import { getCliOptions } from "./tools/cliOptions";
import { getLogger } from "./tools/logger";
@ -22,7 +21,7 @@ for (const keycloakVersion of ["11.0.3", "15.0.2", "18.0.1"]) {
const tmpDirPath = pathJoin(getProjectRoot(), "tmp_xImOef9dOd44");
rm_rf(tmpDirPath);
fs.rmSync(tmpDirPath, { "recursive": true, "force": true });
downloadBuiltinKeycloakTheme({
keycloakVersion,
@ -54,7 +53,7 @@ for (const keycloakVersion of ["11.0.3", "15.0.2", "18.0.1"]) {
});
}
rm_r(tmpDirPath);
fs.rmSync(tmpDirPath, { recursive: true, force: true });
Object.keys(record).forEach(pageType => {
const recordForPageType = record[pageType];

View File

@ -98,7 +98,7 @@ ${ftl_object_to_js_code_declaring_an_object(.data_model, [])?no_esc};
if(fieldName === "${fieldName}" ){
<#attempt>
<#if '${fieldName}' == 'username' || '${fieldName}' == 'password'>
return <#if messagesPerField.exists('username', 'password')>true<#else>false</#if>
return <#if messagesPerField.exists('username') || messagesPerField.exists('password')>true<#else>false</#if>;
<#else>
return <#if messagesPerField.exists('${fieldName}')>true<#else>false</#if>;
</#if>

View File

@ -43,7 +43,8 @@ const commonThirdPartyDeps = (() => {
const yarnHomeDirPath = pathJoin(keycloakifyDirPath, ".yarn_home");
execSync(["rm -rf", "mkdir"].map(cmd => `${cmd} ${yarnHomeDirPath}`).join(" && "));
fs.rmSync(yarnHomeDirPath, { "recursive": true, "force": true });
fs.mkdirSync(yarnHomeDirPath);
const execYarnLink = (params: { targetModuleName?: string; cwd: string }) => {
const { targetModuleName, cwd } = params;

View File

@ -2,7 +2,6 @@ import { basename as pathBasename, join as pathJoin } from "path";
import { execSync } from "child_process";
import * as fs from "fs";
import { transformCodebase } from "./transformCodebase";
import { rm, rm_rf } from "./rm";
import * as crypto from "crypto";
/** assert url ends with .zip */
@ -54,7 +53,7 @@ export function downloadAndUnzip(params: {
[extractDirPath]: false
});
rm_rf(extractDirPath);
fs.rmSync(extractDirPath, { "recursive": true, "force": true });
fs.mkdirSync(extractDirPath);
@ -66,7 +65,7 @@ export function downloadAndUnzip(params: {
"cwd": extractDirPath
});
rm(zipFileBasename, { "cwd": extractDirPath });
fs.rmSync(pathJoin(extractDirPath, zipFileBasename), { "recursive": true, "force": true });
writeIsSuccessByExtractDirPath({
...isSuccessByExtractDirPath,

View File

@ -1,31 +0,0 @@
import { execSync } from "child_process";
function rmInternal(params: { pathToRemove: string; args: string | undefined; cwd: string | undefined }) {
const { pathToRemove, args, cwd } = params;
execSync(`rm ${args ? `-${args} ` : ""}${pathToRemove.replace(/ /g, "\\ ")}`, cwd !== undefined ? { cwd } : undefined);
}
export function rm(pathToRemove: string, options?: { cwd: string }) {
rmInternal({
pathToRemove,
"args": undefined,
"cwd": options?.cwd
});
}
export function rm_r(pathToRemove: string, options?: { cwd: string }) {
rmInternal({
pathToRemove,
"args": "r",
"cwd": options?.cwd
});
}
export function rm_rf(pathToRemove: string, options?: { cwd: string }) {
rmInternal({
pathToRemove,
"args": "rf",
"cwd": options?.cwd
});
}