Support Hungarian and Danish (use Keycloak 15 language resources)
This commit is contained in:
@ -2,32 +2,44 @@
|
||||
import { basename as pathBasename, join as pathJoin } from "path";
|
||||
import { execSync } from "child_process";
|
||||
import fs from "fs";
|
||||
import { transformCodebase } from "../tools/transformCodebase";
|
||||
import { rm_rf, rm, rm_r } from "./rm";
|
||||
import { transformCodebase } from "../tools/transformCodebase";
|
||||
import { rm_rf, rm, rm_r } from "./rm";
|
||||
|
||||
/** assert url ends with .zip */
|
||||
export function downloadAndUnzip(
|
||||
params: {
|
||||
url: string;
|
||||
destDirPath: string;
|
||||
pathOfDirToExtractInArchive?: string;
|
||||
}
|
||||
) {
|
||||
|
||||
const { url, destDirPath } = params;
|
||||
const { url, destDirPath, pathOfDirToExtractInArchive } = params;
|
||||
|
||||
const tmpDirPath = pathJoin(destDirPath, "..", "tmp_xxKdOxnEdx");
|
||||
|
||||
rm_rf(tmpDirPath);
|
||||
|
||||
fs.mkdirSync(tmpDirPath, { "recursive": true });
|
||||
fs.mkdirSync(tmpDirPath, { "recursive": true });
|
||||
|
||||
execSync(`wget ${url}`, { "cwd": tmpDirPath });
|
||||
|
||||
execSync(
|
||||
`unzip ${pathBasename(url)
|
||||
}${pathOfDirToExtractInArchive === undefined ?
|
||||
"" : ` "${pathOfDirToExtractInArchive}/*"`
|
||||
}`,
|
||||
{ "cwd": tmpDirPath }
|
||||
);
|
||||
|
||||
execSync(`wget ${url}`, { "cwd": tmpDirPath })
|
||||
execSync(`unzip ${pathBasename(url)}`, { "cwd": tmpDirPath });
|
||||
rm(pathBasename(url), { "cwd": tmpDirPath });
|
||||
|
||||
transformCodebase({
|
||||
"srcDirPath": tmpDirPath,
|
||||
"destDirPath": destDirPath,
|
||||
"srcDirPath": pathOfDirToExtractInArchive === undefined ?
|
||||
tmpDirPath :
|
||||
pathJoin(tmpDirPath, pathOfDirToExtractInArchive)
|
||||
,
|
||||
destDirPath,
|
||||
});
|
||||
|
||||
rm_r(tmpDirPath);
|
||||
|
Reference in New Issue
Block a user