From 36d982f7f53cbfe6fb19d84b4d3ec88058d750c1 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Mon, 20 Jun 2016 13:03:54 -0700 Subject: [PATCH] Detect DEB and RPM package types Instead of assuming DEB for Linux. --- build.psm1 | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/build.psm1 b/build.psm1 index d01136e2a..151a33759 100644 --- a/build.psm1 +++ b/build.psm1 @@ -483,7 +483,7 @@ Built upon .NET Core, it is also a C# REPL. $appxPackagePath = New-AppxPackage -PackageVersion $Version -SourcePath $Source -AssetsPath "$PSScriptRoot\Assets" -Verbose $packages = @($msiPackagePath, $appxPackagePath) - + return $packages } @@ -493,7 +493,17 @@ Built upon .NET Core, it is also a C# REPL. # Decide package output type if (-not $Type) { - $Type = if ($IsLinux) { "deb" } elseif ($IsOSX) { "osxpkg" } + $Type = if ($IsLinux) { + if ($LinuxInfo.ID -match 'ubuntu') { + "deb" + } elseif ($LinuxInfo.ID -match 'centos') { + "rpm" + } else { + throw "Building packages for $($LinuxInfo.PRETTY_NAME) is unsupported!" + } + } elseif ($IsOSX) { + 'osxpkg' + } Write-Warning "-Type was not specified, continuing with $Type" }