Skip to content

Commit 6893acd

Browse files
author
Robin Stolpe
committed
fixed automation
1 parent be6a737 commit 6893acd

5 files changed

Lines changed: 27 additions & 10 deletions

File tree

MaintainModule/MaintainModule.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<#
2-
Copyright (C) 2022 Robin Stolpe
2+
Copyright (C) 2022 Robin Stolpe.
33
<https://stolpe.io>
44
This program is free software: you can redistribute it and/or modify
55
it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
1818
#
1919
# Generated by: Robin Stolpe
2020
#
21-
# Generated on: 2022-11-20
21+
# Generated on: '2022-11-26'
2222
#
2323

2424
@{

MaintainModule/MaintainModule.psm1

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
1-
1+
<#
2+
Copyright (C) {{year}} Robin Stolpe.
3+
<https://stolpe.io>
4+
This program is free software: you can redistribute it and/or modify
5+
it under the terms of the GNU General Public License as published by
6+
the Free Software Foundation, either version 3 of the License, or
7+
(at your option) any later version.
8+
This program is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
GNU General Public License for more details.
12+
You should have received a copy of the GNU General Public License
13+
along with this program. If not, see <https://www.gnu.org/licenses/>.
14+
#>
15+
#
16+
#
217
Function Uninstall-RSModule {
318
<#
419
.SYNOPSIS

RSPublish.ps1

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ $Version = "0.0.7"
88
#$preReleaseTag = "-beta"
99
#$apiKey = "test"
1010
$Year = (Get-Date).Year
11+
$ManifestDate = Get-Date -Format "yyyy-MM-dd"
1112

1213
# Creating ArrayList for use later in the script
1314
[System.Collections.ArrayList]$FunctionPSD = @()
@@ -21,7 +22,7 @@ $srcPublicFunctionPath = "$($scriptPath)/src/public/function"
2122
$outPSMFile = "$($ModuleFolderPath)/$($ModuleName).psm1"
2223
$outPSDFile = "$($ModuleFolderPath)/$($ModuleName).psd1"
2324
$psdTemplate = "$($srcPath)/$($ModuleName).psd1.source"
24-
$psmLicensPath = "$($srcPath)/FileLicens.ps1"
25+
$psmLicensPath = "$($srcPath)/FileLicens.ps1.source"
2526

2627
Write-OutPut "`n== Preparing $($ModuleName) for publishing ==`n"
2728
Write-OutPut "Starting to build the module, please wait..."
@@ -43,10 +44,10 @@ else {
4344
}
4445

4546
# Adding the text from the filelicens.ps1 to the .psm1 file for licensing of GNU v3
46-
$psmLicens = @( Get-ChildItem -Path $psmLicensPath -ErrorAction SilentlyContinue -Recurse )
47-
$Results = [System.Management.Automation.Language.Parser]::ParseFile($psmLicens, [ref]$null, [ref]$null)
48-
$Functions = $Results.EndBlock.Extent.Text
49-
$Functions | Add-Content -Path $outPSMFile
47+
$psmLicens = Get-Content -Path $psmLicensPath -ErrorAction SilentlyContinue
48+
#$Results = [System.Management.Automation.Language.Parser]::ParseFile($psmLicens, [ref]$null, [ref]$null)
49+
#$Functions = $Results.EndBlock.Extent.Text
50+
$psmLicens | Add-Content -Path $outPSMFile
5051

5152
# Collecting all .ps1 files that are located in src/function folders
5253
Write-Verbose "Collecting all .ps1 files from $($srcPublicFunctionPath)"
@@ -86,6 +87,7 @@ Write-Verbose "Getting the content from file $($outPSDFile)"
8687
$fileContent = Get-Content -Path $outPSDFile
8788

8889
# Changing version, preReleaseTag and function in the .psd1 file
90+
$fileContent = $fileContent -replace '{{manifestDate}}', $ManifestDate
8991
$fileContent = $fileContent -replace '{{moduleName}}', $ModuleName
9092
$fileContent = $fileContent -replace '{{year}}', $Year
9193
$fileContent = $fileContent -replace '{{version}}', $version

src/MaintainModule.psd1.source

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
#
1919
# Generated by: Robin Stolpe
2020
#
21-
# Generated on: 2022-11-20
21+
# Generated on: {{manifestDate}}
2222
#
2323

2424
@{
@@ -84,7 +84,7 @@
8484
# NestedModules = @()
8585

8686
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export.
87-
FunctionsToExport = {{function}}
87+
FunctionsToExport = { { function } }
8888

8989
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
9090
CmdletsToExport = @()

0 commit comments

Comments
 (0)