From 1f5afc6bc61e43ae72c8a38bf045bde48fa1dfac Mon Sep 17 00:00:00 2001 From: Sanne Raymaekers Date: Thu, 30 Jan 2025 13:03:17 +0100 Subject: [PATCH] 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. --- src/store/cockpitApi.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/store/cockpitApi.ts b/src/store/cockpitApi.ts index 0539d3f1..f5d8d102 100644 --- a/src/store/cockpitApi.ts +++ b/src/store/cockpitApi.ts @@ -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));