-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathnotice.ps1
executable file
·32 lines (27 loc) · 1.02 KB
/
notice.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env pwsh
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
#Requires -PSEdition Core
function update-noticefiles {
# use cargo-about to generate a notice files
# notice files are only for wheel distributions
# as no bundled sources are in the sdist.
# llvm special license is already in the template
# as it is a hidden transitive dependency.
# https://github.com/EmbarkStudios/cargo-about
$config = Join-Path $PSScriptRoot notice.toml
foreach ($project in @("pip", "stdlib")) {
Push-Location $project
try {
$template = Join-Path $PSScriptRoot $project notice.hbs
$notice = Join-Path $PSScriptRoot $project NOTICE.txt
cargo about generate --config $config --all-features --output-file $notice $template
$contents = Get-Content -Raw $notice
[System.Web.HttpUtility]::HtmlDecode($contents) | Out-File $notice
}
finally {
Pop-Location
}
}
}
update-noticefiles