From caf655e21f3454e8d2d66a6e356a10f497c484c5 Mon Sep 17 00:00:00 2001 From: Naomi Rose <23469+nomirose@users.noreply.github.com> Date: Fri, 9 Dec 2022 17:31:52 +0000 Subject: [PATCH] feat: Run `trunk upgrade` when a Trunk is detected By implementing this as an `updateContentCommand` script, the results will be cached by the Codespace prebuilds. Additionally, disable Git hooks for now as they seem to be broken, preventing committing or pushing. --- .devcontainer/bin/update_content.sh | 7 +++++++ .devcontainer/devcontainer.json | 1 + .trunk/trunk.yaml | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100755 .devcontainer/bin/update_content.sh diff --git a/.devcontainer/bin/update_content.sh b/.devcontainer/bin/update_content.sh new file mode 100755 index 0000000..cbef872 --- /dev/null +++ b/.devcontainer/bin/update_content.sh @@ -0,0 +1,7 @@ +#!/bin/sh -e + +# If a Trunk configuration directory exists, upgrade Trunk (functionally +# initializing the tool for the first time in this workspace) +if test -d ./.trunk; then + trunk upgrade +fi diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 356dc5f..b966b9f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,7 @@ { "image": "ghcr.io/nomirose/devcontainer:edge", "remoteUser": "root", + "updateContentCommand": ".devcontainer/bin/update_content.sh", "customizations": { "vscode": { "settings": {}, diff --git a/.trunk/trunk.yaml b/.trunk/trunk.yaml index 576236e..84f9c24 100644 --- a/.trunk/trunk.yaml +++ b/.trunk/trunk.yaml @@ -25,7 +25,7 @@ runtimes: - node@16.14.2 actions: enabled: - - trunk-fmt-pre-commit - - trunk-check-pre-push - - commitlint + # - trunk-fmt-pre-commit + # - trunk-check-pre-push + # - commitlint - trunk-upgrade-available