0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-10-30 09:08:00 -04:00

appveyor: use somewhat terser style

This commit is contained in:
Bert Belder 2018-08-17 08:05:05 +02:00
parent 5bdb1ce452
commit d75010ddfe
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461

View file

@ -35,10 +35,10 @@ environment:
# `Delete-Tree` is a simple wrapper around Remove-Item. It doesn't set # `Delete-Tree` is a simple wrapper around Remove-Item. It doesn't set
# an error status if one of the paths to be deleted doesn't exist. # an error status if one of the paths to be deleted doesn't exist.
function Delete-Tree([string[]] $Path) { function Delete-Tree([string[]] $Path) {
$Path | Foreach-Object { $Path | foreach {
"Deleting '$_'" | Write-Host -NoNewLine "Deleting '$_'" | Write-Host -NoNewLine
if (Test-Path -Path $_) { if (Test-Path $_) {
Remove-Item -Path $_ -Recurse -Force -ErrorAction Ignore Remove-Item $_ -Recurse -Force -ErrorAction Ignore
$(if ($?) { " - ok" } else { " - failed" }) | Write-Host $(if ($?) { " - ok" } else { " - failed" }) | Write-Host
} else { } else {
" - not found" | Write-Host " - not found" | Write-Host
@ -88,7 +88,7 @@ install:
} catch { } catch {
# Git will fail if the `third_party` directory was restored from cache, # Git will fail if the `third_party` directory was restored from cache,
# but the `.git/modules` directory wasn't. Rebuild it from scratch. # but the `.git/modules` directory wasn't. Rebuild it from scratch.
Delete-Tree -Path $env:DENO_THIRD_PARTY_PATH Delete-Tree $env:DENO_THIRD_PARTY_PATH
Exec -NoNewLines { & git submodule update --init --force --depth 1 } Exec -NoNewLines { & git submodule update --init --force --depth 1 }
} }
@ -97,7 +97,7 @@ install:
# This step is skipped if the cache is not going to be saved. # This step is skipped if the cache is not going to be saved.
- ps: |- - ps: |-
if ($will_save_cache) { if ($will_save_cache) {
Push-Location -Path $env:DENO_THIRD_PARTY_PATH Push-Location $env:DENO_THIRD_PARTY_PATH
Exec { & git gc --prune=all } Exec { & git gc --prune=all }
Pop-Location Pop-Location
} }
@ -108,9 +108,9 @@ install:
# Make sure the right Python version is in PATH, and others are not. # Make sure the right Python version is in PATH, and others are not.
- ps: |- - ps: |-
# Remove the wrong Python version(s) from PATH. # Remove the wrong Python version(s) from PATH.
$p = $env:PATH -split ";" | Where-Object { $p = $env:PATH -split ";" | where {
-not (Test-Path -Path "$_\python.exe") -and -not (Test-Path "$_\python.exe") -and
-not (Test-Path -Path "$_\pip.exe") -not (Test-Path "$_\pip.exe")
} }
# Add binary dir for `pip --user` packages. # Add binary dir for `pip --user` packages.
$p += "$env:APPDATA\Python\Scripts" $p += "$env:APPDATA\Python\Scripts"
@ -134,11 +134,11 @@ install:
# up because we removed the 'rust-docs' component. # up because we removed the 'rust-docs' component.
# * The actual update is done by removing and reinstalling with rustup-init. # * The actual update is done by removing and reinstalling with rustup-init.
- ps: |- - ps: |-
if ($will_save_cache -and (Test-Path -Path $env:CARGO_HOME)) { if ($will_save_cache -and (Test-Path $env:CARGO_HOME)) {
try { try {
Exec -NoNewLines { & rustup update stable-x86_64-pc-windows-msvc } Exec -NoNewLines { & rustup update stable-x86_64-pc-windows-msvc }
} catch { } catch {
Delete-Tree -Path $env:CARGO_HOME, $env:RUSTUP_HOME Delete-Tree $env:CARGO_HOME, $env:RUSTUP_HOME
} }
} }
@ -149,11 +149,11 @@ install:
# is resolved: https://github.com/rust-lang-nursery/rustup.rs/issues/998. # is resolved: https://github.com/rust-lang-nursery/rustup.rs/issues/998.
# * TODO: Ship Rust in the third_party repo. See issue #386. # * TODO: Ship Rust in the third_party repo. See issue #386.
- ps: |- - ps: |-
if (-not (Test-Path -Path $env:CARGO_HOME)) { if (-not (Test-Path $env:CARGO_HOME)) {
Invoke-WebRequest -Uri "https://win.rustup.rs" ` Invoke-WebRequest -Uri "https://win.rustup.rs" `
-OutFile "$env:TEMP\rustup-init.exe" -OutFile "$env:TEMP\rustup-init.exe"
Exec -NoNewLines { & "$env:TEMP\rustup-init.exe" -y } Exec -NoNewLines { & "$env:TEMP\rustup-init.exe" -y }
Delete-Tree -Path @( Delete-Tree @(
"$env:RUSTUP_HOME\downloads", "$env:RUSTUP_HOME\downloads",
"$env:RUSTUP_HOME\tmp", "$env:RUSTUP_HOME\tmp",
"$env:RUSTUP_HOME\toolchains\stable-x86_64-pc-windows-msvc\share\doc" "$env:RUSTUP_HOME\toolchains\stable-x86_64-pc-windows-msvc\share\doc"