From f359d91cc773b432b9014b46feff81de806ba166 Mon Sep 17 00:00:00 2001 From: Federico Frigo Date: Tue, 19 Sep 2023 16:09:43 +0200 Subject: [PATCH] updates --- LICENSE | 2 +- README.md | 2 +- bin/download | 1 - contributing.md | 1 - lib/utils.bash | 12 +++--------- 5 files changed, 5 insertions(+), 13 deletions(-) diff --git a/LICENSE b/LICENSE index de91979..838241a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -TODO: INSERT YOUR NAME COPYRIGHT YEAR (if applicable to your license) +Federico Frigo Copyright (C) 2023 Apache License Version 2.0, January 2004 diff --git a/README.md b/README.md index 62fb39e..c523a76 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ asdf install secrets-manager latest asdf global secrets-manager latest # Now secrets-manager commands are available -secrets-manager --help +bws --help ``` Check [asdf](https://github.com/asdf-vm/asdf) readme for more instructions on how to diff --git a/bin/download b/bin/download index c11ee53..38c6411 100755 --- a/bin/download +++ b/bin/download @@ -10,7 +10,6 @@ source "${plugin_dir}/lib/utils.bash" mkdir -p "$ASDF_DOWNLOAD_PATH" -# TODO: Adapt this to proper extension and adapt extracting strategy. release_file="$ASDF_DOWNLOAD_PATH/$TOOL_NAME-$ASDF_INSTALL_VERSION.tar.gz" # Download tar.gz file to the download directory diff --git a/contributing.md b/contributing.md index b8a8fd6..7d98f66 100644 --- a/contributing.md +++ b/contributing.md @@ -5,7 +5,6 @@ Testing Locally: ```shell asdf plugin test [--asdf-tool-version ] [--asdf-plugin-gitref ] [test-command*] -# TODO: adapt this asdf plugin test secrets-manager https://github.com/FIAV1/asdf-secrets-manager.git "secrets-manager --help" ``` diff --git a/lib/utils.bash b/lib/utils.bash index 6b1fe92..eeb2e86 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -2,10 +2,9 @@ set -euo pipefail -# TODO: Ensure this is the correct GitHub homepage where releases can be downloaded for secrets-manager. -GH_REPO="https://github.com/FIAV1/asdf-secrets-manager" +GH_REPO="https://github.com/bitwarden/sdk" TOOL_NAME="secrets-manager" -TOOL_TEST="secrets-manager --help" +TOOL_TEST="bws --help" fail() { echo -e "asdf-$TOOL_NAME: $*" @@ -14,7 +13,6 @@ fail() { curl_opts=(-fsSL) -# NOTE: You might want to remove this if secrets-manager is not hosted on GitHub releases. if [ -n "${GITHUB_API_TOKEN:-}" ]; then curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_API_TOKEN") fi @@ -27,12 +25,10 @@ sort_versions() { list_github_tags() { git ls-remote --tags --refs "$GH_REPO" | grep -o 'refs/tags/.*' | cut -d/ -f3- | - sed 's/^v//' # NOTE: You might want to adapt this sed to remove non-version strings from tags + sed 's/^v//' } list_all_versions() { - # TODO: Adapt this. By default we simply list the tag names from GitHub releases. - # Change this function if secrets-manager has other means of determining installable versions. list_github_tags } @@ -41,7 +37,6 @@ download_release() { version="$1" filename="$2" - # TODO: Adapt the release URL convention for secrets-manager url="$GH_REPO/archive/v${version}.tar.gz" echo "* Downloading $TOOL_NAME release $version..." @@ -61,7 +56,6 @@ install_version() { mkdir -p "$install_path" cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path" - # TODO: Assert secrets-manager executable exists. local tool_cmd tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)" test -x "$install_path/$tool_cmd" || fail "Expected $install_path/$tool_cmd to be executable."