Skip to content

Commit

Permalink
Added ReadmePath argument to Set-DescriptionFromReadme
Browse files Browse the repository at this point in the history
  • Loading branch information
majkinetor authored Oct 31, 2017
1 parent ef4222b commit c7a4dc9
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions AU/Public/Set-DescriptionFromReadme.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,18 @@
#>
function Set-DescriptionFromReadme{
param(
[AUPackage] $Package,
[AUPackage] $Package,
# Number of start lines to skip from the README.md, by default 0.
[int] $SkipFirst=0,
# Number of end lines to skip from the README.md, by default 0.
[int] $SkipLast=0
[int] $SkipLast=0,
# Readme file path
[string] $ReadmePath = 'README.md'
)

'Setting package description from README.md'
"Setting package description from $ReadmePath"

$description = gc README.md -Encoding UTF8
$description = gc $ReadmePath -Encoding UTF8
$endIdx = $description.Length - $SkipLast
$description = $description | select -Index ($SkipFirst..$endIdx) | Out-String

Expand All @@ -33,4 +35,4 @@ function Set-DescriptionFromReadme{
$xml_Description.AppendChild($cdata) | Out-Null

$Package.SaveNuspec()
}
}

0 comments on commit c7a4dc9

Please sign in to comment.