mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +01:00
[MIRROR] windows node bootstrapping now downloads node.exe to a separate file before renaming it [MDB IGNORE] (#19508)
* windows node bootstrapping now downloads node.exe to a separate file before renaming it (#73586) This should stop people from getting "corrupt" copies of node.exe in their `./tools/bootstrap/.cache` directory. I checked before making this commit that WebClient.DownloadFile can definitely result in a half-written file. * windows node bootstrapping now downloads node.exe to a separate file before renaming it --------- Co-authored-by: willox <me@wiox.me>
This commit is contained in:
@@ -20,7 +20,8 @@ function Download-Node {
|
||||
Write-Output "Downloading Node v$NodeVersion (may take a while)"
|
||||
New-Item $NodeTargetDir -ItemType Directory -ErrorAction silentlyContinue | Out-Null
|
||||
$WebClient = New-Object Net.WebClient
|
||||
$WebClient.DownloadFile($NodeSource, $NodeTarget)
|
||||
$WebClient.DownloadFile($NodeSource, "$NodeTarget.downloading")
|
||||
Rename-Item "$NodeTarget.downloading" $NodeTarget
|
||||
}
|
||||
|
||||
## Convenience variables
|
||||
|
||||
Reference in New Issue
Block a user