From 39184852d9978f06d0f5c4d8ec6ed7a00e53d737 Mon Sep 17 00:00:00 2001 From: Andrew Schwartzmeyer Date: Thu, 11 Aug 2016 13:16:47 -0700 Subject: [PATCH] Add logic to rename package with runtime suffixed --- build.psm1 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/build.psm1 b/build.psm1 index 041b4672a..34a47325e 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1034,7 +1034,7 @@ It consists of a cross-platform command-line shell and associated scripting lang # Build package try { - Start-NativeExecution { fpm $Arguments } + $Output = Start-NativeExecution { fpm $Arguments } } finally { if ($IsOSX) { # this is continuation of a fpm hack for a weird bug @@ -1044,6 +1044,19 @@ It consists of a cross-platform command-line shell and associated scripting lang } } } + + # Magic to get path output + $Package = Get-Item (Join-Path $PSScriptRoot (($Output[-1] -split ":path=>")[-1] -replace '["{}]')) + + # Add runtime-identifier to package name. + # This information cannot be part of the package, + # but without a repository to host these, + # we need to differentiate distributions by the package's filename. + $PackageWithRuntime = "$($Package.BaseName)-$((New-PSOptions).Runtime)$($Package.Extension)" + + Move-Item -Force $Package $PackageWithRuntime + + return $PackageWithRuntime }