Skip to content

Commit

Permalink
add doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
mircea-pavel-anton committed Sep 29, 2024
1 parent d52c8c4 commit c43b808
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/substitute/pathsubst.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import (
"gopkg.in/yaml.v2"
)

// SubstituteRelativePaths will replace all relative paths in the config file to new paths,
// relative to the working dir from which the CLI has been called.
// When using the `--config-file` flag to point to a file not in the current dir,
// relative path evaluation would fail. This function basically prepends the path to the config
// file to the relative paths in the config file so that their evaluation no longer fails.
func SubstituteRelativePaths(configFilePath string, yamlContent []byte) ([]byte, error) {
// Get the directory of the YAML file
yamlDir := filepath.Dir(configFilePath)
Expand Down

0 comments on commit c43b808

Please sign in to comment.