|
|
@@ -3,7 +3,8 @@
|
|
|
|
|
|
param (
|
|
|
[switch]$WhatIf,
|
|
|
- [switch]$SkipPullRequestCreation
|
|
|
+ [switch]$SkipPullRequestCreation,
|
|
|
+ [switch]$SkipClearCache
|
|
|
)
|
|
|
|
|
|
$ErrorActionPreference = "Stop"
|
|
|
@@ -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"
|
|
|
@@ -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
|