store/cockpitApi: make cache dir in case it doesn't exist
Pass `-p` when creating blueprint directories in case `~/.cache/cockpit-image-builder` doesn't exist yet.
This commit is contained in:
parent
40d1d4cd0f
commit
1f5afc6bc6
1 changed files with 4 additions and 3 deletions
|
|
@ -227,9 +227,10 @@ export const cockpitApi = emptyCockpitApi.injectEndpoints({
|
||||||
try {
|
try {
|
||||||
const id = uuidv4();
|
const id = uuidv4();
|
||||||
const blueprintsDir = await getBlueprintsPath();
|
const blueprintsDir = await getBlueprintsPath();
|
||||||
await cockpit.spawn(['mkdir', id], {
|
await cockpit.spawn(
|
||||||
directory: blueprintsDir,
|
['mkdir', '-p', path.join(blueprintsDir, id)],
|
||||||
});
|
{}
|
||||||
|
);
|
||||||
await cockpit
|
await cockpit
|
||||||
.file(path.join(blueprintsDir, id, `${id}.json`))
|
.file(path.join(blueprintsDir, id, `${id}.json`))
|
||||||
.replace(JSON.stringify(blueprintReq));
|
.replace(JSON.stringify(blueprintReq));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue