-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUpdate-TestExpected.ps1
61 lines (37 loc) · 1010 Bytes
/
Update-TestExpected.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<#PSScriptInfo
.VERSION 1.0
.GUID 2226393d-20b7-4def-9645-d4a1d85e870b
.AUTHOR jdfenw@gmail.com
.COMPANYNAME John D. Fisher
.COPYRIGHT 2024 John D. Fisher
.TAGS
.LICENSEURI https://github.com/jfishe/ctags_markdown/blob/main/LICENSE
.PROJECTURI https://github.com/jfishe/ctags_markdown
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES
.PRIVATEDATA
#>
<#
.DESCRIPTION
Invoke ctags to generate expected tags files.
#>
[CmdletBinding()]
Param()
$exe = Get-Command 'ctags'
$PathCtags = (Get-Item -Path "$PSScriptRoot\ctags.d")
$PathTest = Get-ChildItem -Path "$PSScriptRoot\tests\*.md"
$Parameters = @(
"--options=$PathCtags",
"--sort=no"
)
foreach ($item in $PathTest) {
$TagsOut = "$($item.Directory)\$($item.BaseName)"
$Outfile = "${TagsOut}.expectedtags"
Remove-Item $Outfile -ErrorAction SilentlyContinue
Write-Verbose $item
Write-Verbose $Outfile
&$exe $Parameters -o "$Outfile" "$item"
}