Skip to content

Commit

Permalink
prepare-machine cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nigriMSFT committed Mar 28, 2024
1 parent 10d36c1 commit 04a750e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tools/prepare-machine.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,13 @@ function Download-Fn-DevKit {
$FnDevKitDir = Get-FnDevKitDir
$FnDevKitZip = "$FnDevKitDir/devkit.zip"

if ($Force -and (Test-Path $FnDevKitDir)) {
Remove-Item -Recurse -Force $FnDevKitDir
}
if (!(Test-Path $FnDevKitDir)) {
mkdir $FnDevKitDir | Write-Verbose

Write-Verbose "Downloading Fn dev kit"
Invoke-WebRequest-WithRetry -Uri $FnDevKitUrl -OutFile $FnDevKitZip
Expand-Archive -Path $FnDevKitZip -DestinationPath $FnDevKitDir -Force
Remove-Item -Path $FnDevKitZip
Expand All @@ -191,11 +195,13 @@ function Download-Fn-Runtime {
$FnRuntimeDir = Get-FnRuntimeDir
$FnRuntimeZip = "$FnRuntimeDir/runtime.zip"

if ($Force -and (Test-Path $FnRuntimeDir)) {
Remove-Item -Recurse -Force $FnRuntimeDir
}
if (!(Test-Path $FnRuntimeDir)) {
if (!(Test-Path $FnRuntimeDir)) {
mkdir $FnRuntimeDir | Write-Verbose
}
mkdir $FnRuntimeDir | Write-Verbose

Write-Verbose "Downloading Fn runtime kit"
Invoke-WebRequest-WithRetry -Uri $FnRuntimeUrl -OutFile $FnRuntimeZip
Expand-Archive -Path $FnRuntimeZip -DestinationPath $FnRuntimeDir -Force
Remove-Item -Path $FnRuntimeZip
Expand Down

0 comments on commit 04a750e

Please sign in to comment.