diff --git a/bun.lockb b/bun.lockb index d7e77b2..d3e2214 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 2570de4..5a73d51 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "devDependencies": { "bun-types": "^1.0.18", "gray-matter": "^4.0.3", - "marked": "^11.1.0", + "marked": "^12.0.0", "prettier-plugin-sh": "^0.13.1", "prettier-plugin-terraform-formatter": "^1.2.1" }, diff --git a/vault-github/main.test.ts b/vault-github/main.test.ts index 91ad50b..25934c8 100644 --- a/vault-github/main.test.ts +++ b/vault-github/main.test.ts @@ -1,7 +1,7 @@ import { describe } from "bun:test"; import { runTerraformInit, testRequiredVariables } from "../test"; -describe("vault-token", async () => { +describe("vault-github", async () => { await runTerraformInit(import.meta.dir); testRequiredVariables(import.meta.dir, { diff --git a/vault-github/run.sh b/vault-github/run.sh index 13f871e..8ca96c0 100644 --- a/vault-github/run.sh +++ b/vault-github/run.sh @@ -32,9 +32,19 @@ unzip_safe() { } install() { + # Get the architecture of the system + ARCH=$(uname -m) + if [ "$${ARCH}" = "x86_64" ]; then + ARCH="amd64" + elif [ "$${ARCH}" = "aarch64" ]; then + ARCH="arm64" + else + printf "Unsupported architecture: $${ARCH}\n" + return 1 + fi # Fetch the latest version of Vault if INSTALL_VERSION is 'latest' if [ "$${INSTALL_VERSION}" = "latest" ]; then - LATEST_VERSION=$(curl -s https://releases.hashicorp.com/vault/ | grep -v '-rc' | grep -oP 'vault/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) + LATEST_VERSION=$(curl -s https://releases.hashicorp.com/vault/ | grep -v 'rc' | grep -oE 'vault/[0-9]+\.[0-9]+\.[0-9]+' | sed 's/vault\///' | sort -V | tail -n 1) printf "Latest version of Vault is %s.\n\n" "$${LATEST_VERSION}" if [ -z "$${LATEST_VERSION}" ]; then printf "Failed to determine the latest Vault version.\n" @@ -60,7 +70,7 @@ install() { else printf "Upgrading Vault CLI from version %s to %s ...\n\n" "$${CURRENT_VERSION}" "${INSTALL_VERSION}" fi - fetch vault.zip "https://releases.hashicorp.com/vault/$${INSTALL_VERSION}/vault_$${INSTALL_VERSION}_linux_amd64.zip" + fetch vault.zip "https://releases.hashicorp.com/vault/$${INSTALL_VERSION}/vault_$${INSTALL_VERSION}_linux_$${ARCH}.zip" if [ $? -ne 0 ]; then printf "Failed to download Vault.\n" return 1 diff --git a/vault-token/run.sh b/vault-token/run.sh index cb5125d..e1da6ee 100644 --- a/vault-token/run.sh +++ b/vault-token/run.sh @@ -30,9 +30,19 @@ unzip_safe() { } install() { + # Get the architecture of the system + ARCH=$(uname -m) + if [ "$${ARCH}" = "x86_64" ]; then + ARCH="amd64" + elif [ "$${ARCH}" = "aarch64" ]; then + ARCH="arm64" + else + printf "Unsupported architecture: $${ARCH}\n" + return 1 + fi # Fetch the latest version of Vault if INSTALL_VERSION is 'latest' if [ "$${INSTALL_VERSION}" = "latest" ]; then - LATEST_VERSION=$(curl -s https://releases.hashicorp.com/vault/ | grep -v '-rc' | grep -oP 'vault/\K[0-9]+\.[0-9]+\.[0-9]+' | sort -V | tail -n 1) + LATEST_VERSION=$(curl -s https://releases.hashicorp.com/vault/ | grep -v 'rc' | grep -oE 'vault/[0-9]+\.[0-9]+\.[0-9]+' | sed 's/vault\///' | sort -V | tail -n 1) printf "Latest version of Vault is %s.\n\n" "$${LATEST_VERSION}" if [ -z "$${LATEST_VERSION}" ]; then printf "Failed to determine the latest Vault version.\n"