Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions eng/scripts/update-npm-dependencies.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@

param (
[switch]$WhatIf,
[switch]$SkipPullRequestCreation
[switch]$SkipPullRequestCreation,
[switch]$SkipClearCache
)

$ErrorActionPreference = "Stop"
Expand All @@ -20,6 +21,12 @@ if (-not $WhatIf) {
Remove-Item .\package-lock.json
}

if (-not $SkipClearCache -and -not $WhatIf) {
Write-Host "Clearing the npm cache"
Remove-Item -Recurse -Force "$PWD/src/submodules/Node-Externals/cache"
New-Item -ItemType Directory -Path "$PWD/src/submodules/Node-Externals/cache"
}

try {
Get-Command vsts-npm-auth -CommandType ExternalScript
Write-Host "vsts-npm-auth is already installed"
Expand Down Expand Up @@ -97,7 +104,7 @@ else {
git branch --set-upstream-to=origin/main
git push origin $branchName`:$branchName --force;
gh repo set-default dotnet/Node-Externals
gh pr create --base main --head "infrastructure/update-npm-package-cache-$(Get-Date -Format 'yyyy-MM-dd')" --title "[Infrastructure] Updated npm package cache $(Get-Date -Format 'yyyy-MM-dd')" --body ""
gh pr create --base main --head "infrastructure/update-npm-package-cache-$(Get-Date -Format 'yyyy-MM-dd')" --title "[Infrastructure] Updated npm package cache $(Get-Date -Format 'yyyy-MM-dd')" --body "Do not merge this PR until the one in aspnetcore passes all checks."
}

## Navigate to the root of the repository
Expand Down
Loading