Add logic to rename package with runtime suffixed

This commit is contained in:
Andrew Schwartzmeyer committed 2016-08-11 13:38:54 -07:00
1 parent 49d297c410
commit 39184852d9
1 file changed
+14 -1
+14 -1
View File
@@ -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
}