Skip to content

Commit b43e06d

Browse files
author
Andrew Suderman
authored
Don't parse env on convert command (#578)
1 parent 3e7c741 commit b43e06d

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

cmd/root.go

+1
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ var convertCmd = &cobra.Command{
276276
return validateCobraArgs(cmd, args)
277277
},
278278
Run: func(cmd *cobra.Command, args []string) {
279+
course.ParseEnv = false
279280
newCourse, err := course.OpenCourseFile(courseFile, courseSchema)
280281
if err != nil {
281282
color.Red(err.Error())

pkg/course/course.go

+4
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import (
3434

3535
var (
3636
SchemaValidationError error = errors.New("Course file has schema validation errors")
37+
ParseEnv bool = true
3738
)
3839

3940
// FileV2 is the heart of reckoner, it contains the definitions of the releases to be installed
@@ -641,6 +642,9 @@ func parseSecrets(courseData []byte) error {
641642
}
642643

643644
func parseEnv(data string) (string, error) {
645+
if !ParseEnv {
646+
return data, nil
647+
}
644648
dataWithEnv := os.Expand(data, func(key string) string {
645649
if key == "$" {
646650
return "$"

0 commit comments

Comments
 (0)