Skip to content

Commit d018b6d

Browse files
powershell comments
1 parent ecb3e3c commit d018b6d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/updateNotebookApi.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,42 +37,51 @@ jobs:
3737
# Runs a set of commands using the runners shell
3838
- name: Generate new dts and compare it with the old one
3939
run: |
40+
# This will contain the content of our new file
4041
$fullFile = [System.Collections.Generic.List[string]]@()
4142
$dts = Get-Content ./vscode.proposed.d.ts
4243
44+
# First add everything up to the declare statement
4345
$index = 0
4446
while ($dts[$index] -notmatch "declare module 'vscode' {") {
4547
$fullFile += $dts[$index]
4648
$index++
4749
}
4850
51+
# Add the declare statement
4952
$fullFile += $dts[$index]
5053
54+
# Find the Notebook region start index
5155
for ( $i = $index; $i -lt $dts.Length; $i++) {
5256
if($dts[$i] -match '//#region @rebornix: Notebook') {
5357
$index = $i
5458
break
5559
}
5660
}
5761
62+
# Add everything until the endregion to the new file
5863
while ($dts[$index] -notmatch "//#endregion") {
5964
$fullFile += $dts[$index]
6065
$index++
6166
}
6267
68+
# Add the endregion line and ending brace line
6369
$fullFile += $dts[$index]
6470
$fullFile += '}'
6571
72+
# Overwrite the file with the new content
6673
$fullFile | Set-Content ./vscode.proposed.d.ts
6774
75+
# Get the old and new files' raw text
6876
$oldFile = Get-Content ./old.vscode.proposed.d.ts -Raw
6977
$newFile = Get-Content ./vscode.proposed.d.ts -Raw
7078
79+
# Compare them and log if they are different
7180
if($oldFile -ne $newFile) {
7281
Write-Host "New changes detected!"
7382
}
7483
75-
# Or else tsc will complain.
84+
# Remove the old file so it doesn't get picked up by tsc
7685
Remove-Item ./old.vscode.proposed.d.ts -Force
7786
7887
- name: Compile the TypeScript to check for errors

0 commit comments

Comments
 (0)