From 7021c305e21fa8b7d91d64fcbb1fefd31d5d59b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Hozza?= Date: Wed, 18 Jan 2023 11:44:09 +0100 Subject: [PATCH] osbuild/mkdir: support `parents` stage option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The stage supports a `parents` property in stage path options, which allows one to auto-create any parent directories as needed. Add the property to stage options implementation. Signed-off-by: Tomáš Hozza --- internal/osbuild/mkdir_stage.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/osbuild/mkdir_stage.go b/internal/osbuild/mkdir_stage.go index a46abda63..9cc841807 100644 --- a/internal/osbuild/mkdir_stage.go +++ b/internal/osbuild/mkdir_stage.go @@ -8,9 +8,9 @@ type MkdirStageOptions struct { } type MkdirStagePath struct { - Path string `json:"path"` - - Mode os.FileMode `json:"mode,omitempty"` + Path string `json:"path"` + Mode os.FileMode `json:"mode,omitempty"` // If not specified, the default mode is 0777 + Parents bool `json:"parents,omitempty"` // If true, create parent directories as needed } func (MkdirStageOptions) isStageOptions() {}