Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Federico Frigo committed Sep 19, 2023
1 parent 3b34cfc commit f359d91
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TODO: INSERT YOUR NAME COPYRIGHT YEAR (if applicable to your license)
Federico Frigo <[email protected]> Copyright (C) 2023

Apache License
Version 2.0, January 2004
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion bin/download
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ Testing Locally:
```shell
asdf plugin test <plugin-name> <plugin-url> [--asdf-tool-version <version>] [--asdf-plugin-gitref <git-ref>] [test-command*]

# TODO: adapt this
asdf plugin test secrets-manager https://github.com/FIAV1/asdf-secrets-manager.git "secrets-manager --help"
```

Expand Down
12 changes: 3 additions & 9 deletions lib/utils.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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: $*"
Expand All @@ -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
Expand All @@ -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
}

Expand All @@ -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..."
Expand All @@ -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."
Expand Down

0 comments on commit f359d91

Please sign in to comment.