fix: export-poshtheme ~ issue

Fix regression introduced by previous commit(~)
This commit is contained in:
lnu 2021-05-28 06:59:24 +02:00 committed by Jan De Dobbeleer
parent 46bdc4537d
commit cdd4090c03

View file

@ -150,6 +150,9 @@ function global:Export-PoshTheme {
$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)
}