From 46bdc4537df97629c66b38b66d499573008a2dfa Mon Sep 17 00:00:00 2001 From: lnu Date: Fri, 28 May 2021 06:24:51 +0200 Subject: [PATCH] fix: export-poshtheme issue with relative path Path.GetFullPath used to resolve full or relative paths --- src/init/omp.ps1 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/init/omp.ps1 b/src/init/omp.ps1 index 5592ce5bccf8..ae13b06042e6 100644 --- a/src/init/omp.ps1 +++ b/src/init/omp.ps1 @@ -148,12 +148,9 @@ function global:Export-PoshTheme { $config = $global:PoshSettings.Theme $omp = "::OMP::" $configString = @(&$omp --config="$config" --config-format="$Format" --print-config 2>&1) - # if no path, copy to clipboard by default if ($FilePath -ne "") { - if ($FilePath.StartsWith('~')) { - $FilePath = $FilePath.Replace('~', $HOME) - } + $FilePath = [IO.Path]::GetFullPath($FilePath) [IO.File]::WriteAllLines($FilePath, $configString) } else {