From 1ec8346605a26e114bc805399b60e1280cced107 Mon Sep 17 00:00:00 2001 From: Julian Date: Fri, 6 Nov 2020 07:41:15 +0100 Subject: [PATCH] puppet-bolt: fix GEM_HOME issue (#1558) * puppet-bolt: batch file added to prevent GEM_HOME environment variable from interfering with the execution of `bolt` * puppet-bolt: SETLOCAL added to prevent GEM_HOME being overwritten in cmd session --- bucket/puppet-bolt.json | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bucket/puppet-bolt.json b/bucket/puppet-bolt.json index 30eb118843..d0daf5552c 100644 --- a/bucket/puppet-bolt.json +++ b/bucket/puppet-bolt.json @@ -10,13 +10,19 @@ } }, "extract_dir": "Puppet Labs\\Bolt", + "pre_install": [ + "Set-Content \"$dir\\bolt.bat\" \"@ECHO OFF\" -Encoding Ascii", + "Add-Content \"$dir\\bolt.bat\" \"SETLOCAL\" -Encoding Ascii", + "Add-Content \"$dir\\bolt.bat\" \"SET GEM_HOME=\" -Encoding Ascii", + "Add-Content \"$dir\\bolt.bat\" \"%~dp0\\bin\\bolt.bat %*\" -Encoding Ascii" + ], "post_install": [ "if (Test-Path \"$dir\\share\\install-tarballs\\ruby*.tgz\") {", " info 'Extract tarball of gems...'", " Expand-7zipArchive \"$dir\\share\\install-tarballs\\ruby*.tgz\" \"$dir\" -Removal", "}" ], - "bin": "bin\\bolt.bat", + "bin": "bolt.bat", "checkver": { "url": "https://downloads.puppetlabs.com/windows/puppet/index_by_lastModified_reverse.html", "regex": "puppet-bolt-([\\d.]+)-x64\\.msi"