Create the cache dir path if not exist
This commit is contained in:
parent
a2563f0b7d
commit
49eae307cd
@ -2,7 +2,7 @@ import { getLatestsSemVersionedTagFactory } from "../tools/octokit-addons/getLat
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import cliSelect from "cli-select";
|
||||
import { SemVer } from "../tools/SemVer";
|
||||
import { join as pathJoin } from "path";
|
||||
import { join as pathJoin, dirname as pathDirname } from "path";
|
||||
import * as fs from "fs";
|
||||
import type { ReturnType } from "tsafe";
|
||||
import { id } from "tsafe/id";
|
||||
@ -55,6 +55,14 @@ export async function promptKeycloakVersion(params: { startingFromMajor: number
|
||||
"repo": "keycloak"
|
||||
});
|
||||
|
||||
{
|
||||
const dirPath = pathDirname(cacheFilePath);
|
||||
|
||||
if (!fs.existsSync(dirPath)) {
|
||||
fs.mkdirSync(dirPath, { "recursive": true });
|
||||
}
|
||||
}
|
||||
|
||||
fs.writeFileSync(
|
||||
cacheFilePath,
|
||||
JSON.stringify(
|
||||
|
Loading…
x
Reference in New Issue
Block a user