diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 3313adf..037a52e 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -31,7 +31,7 @@ "source=${localEnv:HOME}${localEnv:USERPROFILE}/.ssh,target=/home/vscode/.ssh,type=bind,consistency=cached" ], - "postCreateCommand": "chmod +x scripts/setup/* && scripts/setup/install-gems.sh && scripts/setup/install-task.sh && chmod 600 /home/vscode/.ssh/*", + "postCreateCommand": "chmod +x scripts/setup/* && scripts/setup/install-gems.sh && scripts/setup/install-task.sh", "features": { "ghcr.io/devcontainers/features/common-utils:2": { "installZsh": true, @@ -53,9 +53,6 @@ "version": "latest", "dotnetVersion": "latest" }, - "ghcr.io/devcontainers/features/ruby:1": { - "version": "latest" - }, "ghcr.io/itsmechlark/features/act:1": { "version": "latest" }, diff --git a/scripts/setup/install-task.sh b/scripts/setup/install-task.sh index 60ba467..18fdaa1 100755 --- a/scripts/setup/install-task.sh +++ b/scripts/setup/install-task.sh @@ -1,2 +1,21 @@ #!/bin/bash +set -x # Enable debug mode to print commands as they execute + +echo "Creating ~/.local/bin directory if it doesn't exist..." +sudo mkdir -p ~/.local/bin +sudo chown vscode:vscode ~/.local/bin +sudo chmod 755 ~/.local/bin + +echo "Installing Task..." sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin + +echo "Checking if ~/.local/bin is in PATH..." +if [[ ":$PATH:" != *":$HOME/.local/bin:"* ]]; then + echo "Adding ~/.local/bin to PATH in ~/.zshrc" + echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc + export PATH="$HOME/.local/bin:$PATH" +fi + +echo "Verifying task installation..." +which task || echo "Task not found in PATH" +task --version || echo "Task command not working"