From 894b84fa85191a06a3274ec778c3c376d6eef2f1 Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Fri, 21 May 2021 08:23:12 +0200 Subject: [PATCH] fix(pwsh): get filesystem path for configs resolves #715 --- packages/powershell/oh-my-posh/oh-my-posh.psm1 | 5 +++-- src/init/omp.ps1 | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/powershell/oh-my-posh/oh-my-posh.psm1 b/packages/powershell/oh-my-posh/oh-my-posh.psm1 index 7b24340f..3f4fb997 100644 --- a/packages/powershell/oh-my-posh/oh-my-posh.psm1 +++ b/packages/powershell/oh-my-posh/oh-my-posh.psm1 @@ -51,10 +51,11 @@ function Set-PoshPrompt { $config = "" if (Test-Path "$PSScriptRoot/themes/$Theme.omp.json") { - $config = "$PSScriptRoot/themes/$Theme.omp.json" + $path = "$PSScriptRoot/themes/$Theme.omp.json" + $config = (Resolve-Path -Path $path).ProviderPath } elseif (Test-Path $Theme) { - $config = (Resolve-Path -Path $Theme).Path + $config = (Resolve-Path -Path $Theme).ProviderPath } else { $config = "$PSScriptRoot/themes/jandedobbeleer.omp.json" diff --git a/src/init/omp.ps1 b/src/init/omp.ps1 index 9a54d5de..da52ace3 100644 --- a/src/init/omp.ps1 +++ b/src/init/omp.ps1 @@ -13,7 +13,7 @@ $global:omp_lastHistoryId = -1 $config = "::CONFIG::" if (Test-Path $config) { - $global:PoshSettings.Theme = (Resolve-Path -Path $config).Path + $global:PoshSettings.Theme = (Resolve-Path -Path $config).ProviderPath } function global:Set-PoshContext {}