From 452f41aa86d498eae90fb72b6bd71cc586d203f6 Mon Sep 17 00:00:00 2001 From: Parkreiner Date: Mon, 24 Jun 2024 20:17:31 +0000 Subject: [PATCH] fix: add parenthesis --- windows-rdp/main.tf | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/windows-rdp/main.tf b/windows-rdp/main.tf index 30f1a1e..a098669 100644 --- a/windows-rdp/main.tf +++ b/windows-rdp/main.tf @@ -93,13 +93,15 @@ resource "coder_script" "windows-rdp" { $root = "C:\Program Files\Devolutions\Gateway\webapp\client" $devolutionsHtml = "$root\index.html" $patch = '' - $isPatched = Select-String -Path "$devolutionsHtml" -Pattern "$patch" + # Always copy the file in case we change it. - "templatefile("${path.module}/devolutions-patch.js", { + "${templatefile("${path.module}/devolutions-patch.js", { CODER_USERNAME : var.admin_username, CODER_PASSWORD : var.admin_password, - }" | Set-Content "$root\coder.js" + })}" | Set-Content "$root\coder.js" + # Only inject the src if we have not before. + $isPatched = Select-String -Path "$devolutionsHtml" -Pattern "$patch" if ($isPatched -eq $null) { (Get-Content $devolutionsHtml).Replace('', "$patch") | Set-Content $devolutionsHtml }