From aab5e55663f951c1f0c1f27119bd6c4db582b80d Mon Sep 17 00:00:00 2001 From: Parkreiner Date: Mon, 24 Jun 2024 20:10:22 +0000 Subject: [PATCH] fix: update script frequency --- windows-rdp/main.tf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/windows-rdp/main.tf b/windows-rdp/main.tf index de3d408..99de193 100644 --- a/windows-rdp/main.tf +++ b/windows-rdp/main.tf @@ -94,12 +94,13 @@ resource "coder_script" "windows-rdp" { $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", { + CODER_USERNAME : var.admin_username, + CODER_PASSWORD : var.admin_password, + }" | Set-Content "$root\coder.js" + # Only inject the src if we have not before. if ($isPatched -e $null) { - "templatefile("${path.module}/devolutions-patch.js", { - CODER_USERNAME : var.admin_username, - CODER_PASSWORD : var.admin_password, - }" | Set-Content "$root\coder.js" - (Get-Content $devolutionsHtml).Replace('', "$patch") | Set-Content $devolutionsHtml } }