Skip to content

Commit 5fb7f25

Browse files
🪲 [Fix]: Add copyright information to module manifest (#88)
## Description This pull request includes changes to the `Build-PSModuleManifest.ps1` script and the `manifest.psd1` test file to correct a typo and add new properties. - Fixes #86 - Fixes #87 Fixes and enhancements: * [`scripts/helpers/Build/Build-PSModuleManifest.ps1`](diffhunk://#diff-50cfb011f5c8aeef8145003927ec3e5edfdf26e5d417bcee6e441517c07454f9L66-R69): Corrected casing on `CopyRight` to `Copyright` in multiple instances. Test file updates: * [`tests/srcWithManifest/manifest.psd1`](diffhunk://#diff-399c133608e76653ee44cfb1565529498f11aa4741e3ce9a5abc2e6a9b005554R4-R5): Added `Copyright` and `Description` properties to the manifest for testing purposes. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 5df24bf commit 5fb7f25

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

scripts/helpers/Build/Build-PSModuleManifest.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ function Build-PSModuleManifest {
6363
Write-Verbose "[CompanyName] - [$($manifest.CompanyName)]"
6464

6565
$year = Get-Date -Format 'yyyy'
66-
$copyRightOwner = $manifest.CompanyName -eq $manifest.Author ? $manifest.Author : "$($manifest.Author) | $($manifest.CompanyName)"
67-
$copyRight = "(c) $year $copyRightOwner. All rights reserved."
68-
$manifest.CopyRight = $manifest.Keys -contains 'CopyRight' ? -not [string]::IsNullOrEmpty($manifest.CopyRight) ? $manifest.CopyRight : $copyRight : $copyRight
69-
Write-Verbose "[CopyRight] - [$($manifest.CopyRight)]"
66+
$copyrightOwner = $manifest.CompanyName -eq $manifest.Author ? $manifest.Author : "$($manifest.Author) | $($manifest.CompanyName)"
67+
$copyright = "(c) $year $copyrightOwner. All rights reserved."
68+
$manifest.Copyright = $manifest.Keys -contains 'Copyright' ? -not [string]::IsNullOrEmpty($manifest.Copyright) ? $manifest.Copyright : $copyright : $copyright
69+
Write-Verbose "[Copyright] - [$($manifest.Copyright)]"
7070

7171
$repoDescription = gh repo view --json description | ConvertFrom-Json | Select-Object -ExpandProperty description
7272
$manifest.Description = $manifest.Keys -contains 'Description' ? ($manifest.Description | IsNotNullOrEmpty) ? $manifest.Description : $repoDescription : $repoDescription

tests/srcWithManifest/manifest.psd1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
@{
22
ModuleVersion = '0.0.0'
33
RootModule = 'PSModuleTest.psm1'
4+
Copyright = 'Test'
5+
Description = 'This is a test module.'
46
}

0 commit comments

Comments
 (0)