-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added CI job to ensure VS Code versions match in npm configs (#23)
- Loading branch information
1 parent
d6693c3
commit 8605870
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
.github/ci/scripts/Confirm-NpmVisualStudioCodeVersionsMatch.ps1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# File Name: Confirm-NpmVisualStudioCodeVersionsMatch.ps1 | ||
# Author: Darian Benam <[email protected]> | ||
# Date Created: Saturday, July 13, 2024 | ||
# Date Updated: Saturday, July 13, 2024 | ||
|
||
#Requires -Version 7 | ||
|
||
param( | ||
[Parameter(Mandatory = $true)] | ||
[string] $NpmPackageJsonPath, | ||
[Parameter(Mandatory = $true)] | ||
[string] $NpmPackageLockJsonPath | ||
) | ||
|
||
$NpmPackageJson = Get-Content -Raw -Path $NpmPackageJsonPath | ConvertFrom-Json -AsHashTable | ||
$NpmPackageLockJson = Get-Content -Raw -Path $NpmPackageLockJsonPath | ConvertFrom-Json -AsHashTable | ||
|
||
if ($NpmPackageJson.engines.vscode -ne $NpmPackageJson.devDependencies.'@types/vscode') | ||
{ | ||
Write-Error "Visual Studio Code Versions do not match in '$NpmPackageJsonPath'!" | ||
exit 1 | ||
} | ||
|
||
$NpmPackageLockJsonPackageParent = $NpmPackageLockJson.packages.'' | ||
|
||
if ($NpmPackageLockJsonPackageParent.engines.vscode -ne $NpmPackageLockJsonPackageParent.devDependencies.'@types/vscode') | ||
{ | ||
Write-Error "Visual Studio Code Versions do not match in '$NpmPackageLockJsonPath'!" | ||
exit 1 | ||
} | ||
|
||
Write-Output 'Versions Match' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters