Skip to content

Commit dc343a3

Browse files
author
Richard Cheney
committed
Expand tilde for chdir
1 parent ee83c51 commit dc343a3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/ALZ/Private/Deploy-Accelerator-Helpers/Invoke-Terraform.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ function Invoke-Terraform {
2323
[switch] $silent
2424
)
2525

26+
# Avoid bootstrap Terraform chdir errors if ~ in moduleFolderPath
27+
if ($env:HOME -and $env:HOME -ne "" -and $moduleFolderPath -match '^(~)') {
28+
$moduleFolderPath = $moduleFolderPath -replace '^(~)', $env:HOME
29+
}
30+
2631
if ($PSCmdlet.ShouldProcess("Apply Terraform", "modify")) {
2732
# Check and Set Subscription ID
2833
$removeSubscriptionId = $false

0 commit comments

Comments
 (0)