- "UpdateSourceArgs": "-NoProfile -Command \"$env:PATH = \\\"{{$FullRootDir}}bun\\bin;\\\" + $env:PATH; $ProgressPreference='SilentlyContinue'; $BunVersion='{{BunVersion}}'; Set-Location -Path 'bun-app-runner'; if (Test-Path 'bun/bin/bun.exe') { $InstalledVersion = & bun/bin/bun.exe --version } else { $InstalledVersion = '' }; if ([string]::IsNullOrWhiteSpace($BunVersion) -and -not [string]::IsNullOrWhiteSpace($InstalledVersion)) { & bun/bin/bun.exe upgrade; exit 0 } elseif ([string]::IsNullOrWhiteSpace($BunVersion)) { $BunVersion=((Invoke-RestMethod -UseBasicParsing -Uri \\\"https://api.github.com/repos/oven-sh/bun/releases/latest\\\").tag_name -replace '^bun-', '') }; if ($BunVersion -notmatch '^v\\d+\\.\\d+\\.\\d+$') { Write-Output \\\"Invalid Bun version format specified\\\"; exit 1 }; $BunVersionStripped = $BunVersion -replace '^v', ''; if ( $InstalledVersion -eq $BunVersionStripped ) { Write-Output \\\"Bun $BunVersion already installed. Skipping\\\"; exit 0 }; $Target='windows-x64'; if (!(Add-Type -MemberDefinition '[DllImport(\\\"kernel32.dll\\\")] public static extern bool IsProcessorFeaturePresent(int ProcessorFeature);' -Name 'Kernel32' -Namespace 'Win32' -PassThru)::IsProcessorFeaturePresent(40)) { $Target='windows-x64-baseline' }; Invoke-WebRequest -UseBasicParsing -Uri https://github.com/oven-sh/bun/releases/download/bun-$BunVersion/bun-$Target.zip -OutFile 'bun.zip'; if ($?) { Expand-Archive -Path \\\"bun.zip\\\" -DestinationPath \\\"bun\\bin\\\" -Force *> $null; Move-Item \\\"bun\\bin\\bun-$Target\\bun.exe\\\" \\\"bun\\bin\\bun.exe\\\" -Force *> $null; Remove-Item \\\"bun\\bin\\bun-$Target\\\" -Recurse -Force; Remove-Item \\\"bun.zip\\\" -Force; & bun/bin/bun.exe completions *> $null; Write-Output \\\"Bun $BunVersion installed\\\" }\"",
0 commit comments