feat(dotfiles): move script to run.sh

pull/133/head
Phorcys 1 year ago
parent f16d7ca3f5
commit d6b338ce2f

@ -25,13 +25,10 @@ data "coder_parameter" "dotfiles_uri" {
}
resource "coder_script" "personalize" {
agent_id = var.agent_id
script = <<-EOT
DOTFILES_URI="${data.coder_parameter.dotfiles_uri.value}"
if [ -n "$${DOTFILES_URI// }" ]; then
coder dotfiles "$DOTFILES_URI" -y 2>&1 | tee -a ~/.dotfiles.log
fi
EOT
agent_id = var.agent_id
script = templatefile("${path.module}/run.sh", {
DOTFILES_URI : data.coder_parameter.dotfiles_uri.value,
})
display_name = "Dotfiles"
icon = "/icon/dotfiles.svg"
run_on_start = true

@ -0,0 +1,7 @@
DOTFILES_URI="${DOTFILES_URI}"
ROOT="${ROOT}"
if [ -n "$${DOTFILES_URI// }" ]; then
echo "✨ Applying dotfiles for user $USER"
coder dotfiles "$DOTFILES_URI" -y 2>&1 | tee -a ~/.dotfiles.log
fi
Loading…
Cancel
Save