From cf5535c571fb0d0ce4ecb5bc21fa16564a3d2249 Mon Sep 17 00:00:00 2001 From: Travis Plunk Date: Wed, 6 Jun 2018 12:15:33 -0700 Subject: [PATCH] Get the fix for this issue with installing fpm https://github.com/jordansissel/fpm/pull/1494 # Conflicts: # build.psm1 --- build.psm1 | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/build.psm1 b/build.psm1 index a6ee006028..eded9139e2 100644 --- a/build.psm1 +++ b/build.psm1 @@ -1,3 +1,6 @@ +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. + # On Unix paths is separated by colon # On Windows paths is separated by semicolon $script:TestModulePathSeparator = [System.IO.Path]::PathSeparator @@ -1614,9 +1617,14 @@ function Start-PSBootstrap { # Install [fpm](https://github.com/jordansissel/fpm) and [ronn](https://github.com/rtomayko/ronn) if ($Package) { try { - # We cannot guess if the user wants to run gem install as root - Start-NativeExecution { gem install fpm -v 1.9.3 } - Start-NativeExecution { gem install ronn -v 0.7.3 } + # We cannot guess if the user wants to run gem install as root on linux and windows, + # but macOs usually requires sudo + $gemsudo = '' + if($Environment.IsMacOS) { + $gemsudo = $sudo + } + Start-NativeExecution ([ScriptBlock]::Create("$gemsudo gem install fpm -v 1.10.0")) + Start-NativeExecution ([ScriptBlock]::Create("$gemsudo gem install ronn -v 0.7.3")) } catch { Write-Warning "Installation of fpm and ronn gems failed! Must resolve manually." }