Skip to content
Snippets Groups Projects
Commit 95cd54270043 authored by Steeven Herlant's avatar Steeven Herlant
Browse files

feat: namespace beaver can now be a variable

parent 614e21f6f487
No related branches found
Tags 3.2.1
No related merge requests found
Pipeline #68330 failed
......@@ -36,5 +36,9 @@
// Build is in charge of applying commands based on the config data
func (r *Runner) Build(tmpDir string) error {
variables, err := r.config.prepareVariables(false)
if err != nil {
return fmt.Errorf("cannot prepare variables: %w", err)
}
var outputDir string
if r.config.Output == "" {
......@@ -39,5 +43,10 @@
var outputDir string
if r.config.Output == "" {
w := bytes.NewBuffer([]byte{})
if err := hydrateString(r.config.Namespace, w, variables); err != nil {
return err
}
r.config.Namespace = w.String()
outputDir = filepath.Join(r.config.RootDir, "build", r.config.Namespace)
} else {
outputDir = r.config.Output
......@@ -59,7 +68,7 @@
return fmt.Errorf("cannot clean dir: %s: %w", outputDir, err)
}
}
variables, err := r.config.prepareVariables(true)
variables, err = r.config.prepareVariables(true)
if err != nil {
return fmt.Errorf("cannot prepare variables: %w", err)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment