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
This commit is contained in:
Julian 2020-11-06 07:41:15 +01:00 committed by GitHub
parent 60f6d0f76f
commit 1ec8346605
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -10,13 +10,19 @@
} }
}, },
"extract_dir": "Puppet Labs\\Bolt", "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": [ "post_install": [
"if (Test-Path \"$dir\\share\\install-tarballs\\ruby*.tgz\") {", "if (Test-Path \"$dir\\share\\install-tarballs\\ruby*.tgz\") {",
" info 'Extract tarball of gems...'", " info 'Extract tarball of gems...'",
" Expand-7zipArchive \"$dir\\share\\install-tarballs\\ruby*.tgz\" \"$dir\" -Removal", " Expand-7zipArchive \"$dir\\share\\install-tarballs\\ruby*.tgz\" \"$dir\" -Removal",
"}" "}"
], ],
"bin": "bin\\bolt.bat", "bin": "bolt.bat",
"checkver": { "checkver": {
"url": "https://downloads.puppetlabs.com/windows/puppet/index_by_lastModified_reverse.html", "url": "https://downloads.puppetlabs.com/windows/puppet/index_by_lastModified_reverse.html",
"regex": "puppet-bolt-([\\d.]+)-x64\\.msi" "regex": "puppet-bolt-([\\d.]+)-x64\\.msi"