From 3be47e70c8e19a7252f767fe314674f859bef893 Mon Sep 17 00:00:00 2001 From: Jared Haight <1220886+jaredhaight@users.noreply.github.com> Date: Sat, 31 Mar 2018 12:41:59 -0700 Subject: [PATCH] Only check packer version if not VagrantOnly --- build.ps1 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build.ps1 b/build.ps1 index dd602c5..35a6776 100644 --- a/build.ps1 +++ b/build.ps1 @@ -217,6 +217,16 @@ function preflight_checks { if (-Not ($VagrantOnly)) { Write-Verbose '[preflight_checks] Checking if packer is installed' check_packer + + # Check Packer Version against known bad + Write-Verbose '[preflight_checks] Checking for bad packer version..' + [System.Version]$PackerVersion = $(& $PackerPath "--version") + [System.Version]$PackerKnownBad = 1.1.2 + + if ($PackerVersion -eq $PackerKnownBad) { + Write-Error 'Packer 1.1.2 is not supported. Please upgrade to a newer version and see https://github.com/hashicorp/packer/issues/5622 for more information.' + break + } } Write-Verbose '[preflight_checks] Checking if vagrant is installed' check_vagrant @@ -255,16 +265,6 @@ function preflight_checks { } Write-Output "You can safely ignore this warning if you are deploying DetectionLab to a different drive." } - - # Check Packer Version against known bad - Write-Verbose '[preflight_checks] Checking for bad packer version..' - [System.Version]$PackerVersion = $(& $PackerPath "--version") - [System.Version]$PackerKnownBad = 1.1.2 - - if ($PackerVersion -eq $PackerKnownBad) { - Write-Error 'Packer 1.1.2 is not supported. Please upgrade to a newer version and see https://github.com/hashicorp/packer/issues/5622 for more information.' - break - } # Ensure the vagrant-reload plugin is installed Write-Verbose '[preflight_checks] Checking if vagrant-reload is installed..'