Skip to content

Commit

Permalink
Add support for absolute source #237
Browse files Browse the repository at this point in the history
  • Loading branch information
BernieWhite committed Oct 22, 2024
1 parent 001a0fc commit a602efc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions docs/CHANGELOG-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ See [upgrade notes][upgrade-notes] for helpful information when upgrading from p

## Unreleased

What's changed since v2.9.0:

- General improvements:
- Added support for specifying an absolutely source path by @BernieWhite.
[#237](https://github.com/microsoft/ps-rule/issues/237)

## v2.9.0

What's changed since v2.8.1:
Expand Down
8 changes: 4 additions & 4 deletions powershell.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,11 @@ else {
}

# Set Source
if ([String]::IsNullOrEmpty($Source)) {
$Source = Join-Path -Path $Path -ChildPath '.ps-rule/';
if ([String]::IsNullOrWhiteSpace($Source)) {
$Source = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($Path, '.ps-rule/'))
}
else {
$Source = Join-Path -Path $Path -ChildPath $Source;
elseif (![System.IO.Path]::IsPathFullyQualified($Source)) {
$Source = [System.IO.Path]::GetFullPath([System.IO.Path]::Combine($Path, $Source))
}

# Set conventions
Expand Down

0 comments on commit a602efc

Please sign in to comment.