Skip to content

Commit

Permalink
(#51) Linux: forbid interactivity during apt-get
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Dec 5, 2021
1 parent ed8178c commit d914ea6
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions linux/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,31 @@ param (
$ErrorActionPreference = 'Stop'
Set-StrictMode -Version Latest

$dependencies = @(
'cmake'
'gperf'
'make'
'git'
'zlib1g-dev'
'libssl-dev'
'gperf'
'php-cli'
'cmake'
'g++'
)
try {
# The following command requires installing tzdata which is interactive, so let's forbid its interactivity.
$oldDebianFrontend = $env:DEBIAN_FRONTEND
$env:DEBIAN_FRONTEND=noninteractive
$dependencies = @(
'cmake'
'gperf'
'make'
'git'
'zlib1g-dev'
'libssl-dev'
'gperf'
'php-cli'
'cmake'
'g++'
)

Write-Output 'Installing dependencies.'
apt-get install -y @dependencies
if (!$?) { throw 'Cannot install dependencies from apt-get' }
Write-Output 'Installing dependencies.'
apt-get install -y @dependencies
if (!$?) {
throw 'Cannot install dependencies from apt-get'
}
} finally {
$env:DEBIAN_FRONTEND = $oldDebianFrontend
}

Write-Output "Downloading NuGet client to $NuGetPath"
New-Item -Type Directory ([IO.Path]::GetDirectoryName($NuGetPath))
Expand Down

0 comments on commit d914ea6

Please sign in to comment.