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 {
|
||||
const id = uuidv4();
|
||||
const blueprintsDir = await getBlueprintsPath();
|
||||
await cockpit.spawn(['mkdir', id], {
|
||||
directory: blueprintsDir,
|
||||
});
|
||||
await cockpit.spawn(
|
||||
['mkdir', '-p', path.join(blueprintsDir, id)],
|
||||
{}
|
||||
);
|
||||
await cockpit
|
||||
.file(path.join(blueprintsDir, id, `${id}.json`))
|
||||
.replace(JSON.stringify(blueprintReq));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue