fix(project): fully qualified project path

fix an issue with pwsh reading the file from users home instead of cwd
This commit is contained in:
lnu 2022-04-06 09:57:33 +02:00 committed by Jan De Dobbeleer
parent 303793632b
commit f754826eb5

View file

@ -397,6 +397,9 @@ func (env *ShellEnvironment) HasFolder(folder string) bool {
func (env *ShellEnvironment) FileContent(file string) string {
defer env.trace(time.Now(), "FileContent", file)
if !filepath.IsAbs(file) {
file = filepath.Join(env.Pwd(), file)
}
content, err := ioutil.ReadFile(file)
if err != nil {
env.log(Error, "FileContent", err.Error())