diff --git a/registry/coder/modules/dotfiles/main.test.ts b/registry/coder/modules/dotfiles/main.test.ts index 8c82cd1e..f13c8663 100644 --- a/registry/coder/modules/dotfiles/main.test.ts +++ b/registry/coder/modules/dotfiles/main.test.ts @@ -28,6 +28,21 @@ describe("dotfiles", async () => { expect(state.outputs.dotfiles_uri.value).toBe(default_dotfiles_uri); }); + it("command uses bash for fish shell compatibility", async () => { + const state = await runTerraformApply(import.meta.dir, { + agent_id: "foo", + manual_update: "true", + dotfiles_uri: "https://github.com/test/dotfiles", + }); + + const app = state.resources.find( + (r) => r.type === "coder_app" && r.name === "dotfiles" + ); + + expect(app).toBeDefined(); + expect(app?.instances[0]?.attributes?.command).toContain("/bin/bash -c"); + }); + it("set custom order for coder_parameter", async () => { const order = 99; const state = await runTerraformApply(import.meta.dir, { diff --git a/registry/coder/modules/dotfiles/main.tf b/registry/coder/modules/dotfiles/main.tf index 22c61dcf..fbf395df 100644 --- a/registry/coder/modules/dotfiles/main.tf +++ b/registry/coder/modules/dotfiles/main.tf @@ -99,7 +99,7 @@ resource "coder_app" "dotfiles" { icon = "/icon/dotfiles.svg" order = var.order group = var.group - command = "/usr/bin/env bash -c ${shellquote(templatefile("${path.module}/run.sh", { + command = "/bin/bash -c ${jsonencode(templatefile("${path.module}/run.sh", { DOTFILES_URI : local.dotfiles_uri, DOTFILES_USER : local.user }))}"