Skip to content

Commit

Permalink
fix: export-poshtheme issue with relative path
Browse files Browse the repository at this point in the history
Path.GetFullPath used to resolve full or relative paths
  • Loading branch information
lnu authored and JanDeDobbeleer committed May 28, 2021
1 parent 79fa990 commit 46bdc45
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/init/omp.ps1
Expand Up @@ -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 {
Expand Down

0 comments on commit 46bdc45

Please sign in to comment.