mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
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:
parent
303793632b
commit
f754826eb5
|
@ -397,6 +397,9 @@ func (env *ShellEnvironment) HasFolder(folder string) bool {
|
||||||
|
|
||||||
func (env *ShellEnvironment) FileContent(file string) string {
|
func (env *ShellEnvironment) FileContent(file string) string {
|
||||||
defer env.trace(time.Now(), "FileContent", file)
|
defer env.trace(time.Now(), "FileContent", file)
|
||||||
|
if !filepath.IsAbs(file) {
|
||||||
|
file = filepath.Join(env.Pwd(), file)
|
||||||
|
}
|
||||||
content, err := ioutil.ReadFile(file)
|
content, err := ioutil.ReadFile(file)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
env.log(Error, "FileContent", err.Error())
|
env.log(Error, "FileContent", err.Error())
|
||||||
|
|
Loading…
Reference in a new issue