Adds support for dot-prefixed paths in git
- in `flux bootstrap` and `flux create kustomization` etc. - E.g. for example `--path=.flux` should work now - Previous behaviour is to strip off any leading "." and leave you with "./flux" in the kustomizations / folder structure generated by `flux bootstrap` Signed-off-by: Simon Howe <footless@gmail.com>
This commit is contained in:
@@ -41,7 +41,10 @@ func (p *SafeRelativePath) Set(str string) error {
|
||||
return fmt.Errorf("invalid relative path '%s': %w", cleanP, err)
|
||||
}
|
||||
// NB: required, as a secure join of "./" will result in "."
|
||||
cleanP = fmt.Sprintf("./%s", strings.TrimPrefix(cleanP, "."))
|
||||
if cleanP == "." {
|
||||
cleanP = ""
|
||||
}
|
||||
cleanP = fmt.Sprintf("./%s", cleanP)
|
||||
*p = SafeRelativePath(cleanP)
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user