Sync eng/common directory with azure-sdk-tools for PR 5595 (#4400)

* Use "npm ci" to install cspell and respect package-lock.json

* Review feedback

* Pipe npm ci output to Write-Host

---------

Co-authored-by: Daniel Jurek <djurek@microsoft.com>
This commit is contained in:
Azure SDK Bot 2023-03-03 07:28:46 -08:00 committed by GitHub
parent ecb5f3db1c
commit ab7b238197
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,7 +25,7 @@ created in the temp folder, package*.json files will be placed in that folder.
.PARAMETER LeavePackageInstallCache
If set the PackageInstallCache will not be deleted. Use if there are multiple
calls to Invoke-Cspell.ps1 to prevent creating multiple working directories and
redundant calls `npm install`.
redundant calls `npm ci`.
.PARAMETER Test
Run test functions against the script logic
@ -167,9 +167,7 @@ $originalLocation = Get-Location
try {
Set-Location $PackageInstallCache
npm install npx | Out-Null
npm install cspell | Out-Null
npm install | Out-Null
npm ci | Write-Host
# Use the mutated configuration file when calling cspell
$command = "npx cspell $JobType --config $CSpellConfigPath --no-must-find-files --root $SpellCheckRoot --relative"