feat(dotfiles): move script to run.sh

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

@ -26,12 +26,9 @@ data "coder_parameter" "dotfiles_uri" {
resource "coder_script" "personalize" { resource "coder_script" "personalize" {
agent_id = var.agent_id agent_id = var.agent_id
script = <<-EOT script = templatefile("${path.module}/run.sh", {
DOTFILES_URI="${data.coder_parameter.dotfiles_uri.value}" 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
display_name = "Dotfiles" display_name = "Dotfiles"
icon = "/icon/dotfiles.svg" icon = "/icon/dotfiles.svg"
run_on_start = true 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