-
Notifications
You must be signed in to change notification settings - Fork 385
/
Copy pathupdate.ps1
43 lines (36 loc) · 1.08 KB
/
update.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
33
34
35
36
37
38
39
40
41
42
43
. $PSScriptRoot\..\python3-streams\update.ps1
if ($MyInvocation.InvocationName -ne '.') {
function global:au_SearchReplace {
@{
".\README.md" = @{
"(?i)(install the package )\[python\d+]\((.*)python\d+" = "`$1[$($Latest.Dependency)](`$2$($Latest.Dependency)"
"(?i)(the package )``python\d+``( must also)" = "`$1``$($Latest.Dependency)```$2"
}
}
}
}
function global:au_BeforeUpdate {
SetCopyright
}
function global:au_AfterUpdate($Package) {
Set-DescriptionFromReadme $Package -SkipFirst 2
Update-Metadata -data @{
dependency = "$($Latest.Dependency)|[$($Latest.Version)]"
copyright = $Latest.Copyright
licenseUrl = $Latest.LicenseUrl
}
}
function global:au_GetLatest {
$streams = GetReleaseFilesStreams
$streams.Keys | ForEach-Object {
$item = $streams[$_]
$pkgName = $item.PackageName
$item.Remove('PackageName') | Out-Null
$item.Remove('Title') | Out-Null
$item['Dependency'] = $pkgName
}
@{ Streams = $streams }
}
if ($MyInvocation.InvocationName -ne '.') {
update -ChecksumFor none -NoReadme
}