Skip to content

Commit 1ba8ac7

Browse files
Merge pull request #1 from signavio/update-repo
feat: update repo to xterrafile
2 parents 10e37ba + 32ab323 commit 1ba8ac7

File tree

7 files changed

+34
-37
lines changed

7 files changed

+34
-37
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ jobs:
1919
- name: asdf_plugin_test
2020
uses: asdf-vm/actions/plugin-test@v1
2121
with:
22-
command: aws-mfa-login --version
22+
command: xterrafile version
2323
github_token: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<div align="center">
22

3-
# asdf-aws-mfa-login [![Build](https://github.com/signavio/asdf-aws-mfa-login/actions/workflows/build.yml/badge.svg)](https://github.com/signavio/asdf-aws-mfa-login/actions/workflows/build.yml) [![Lint](https://github.com/signavio/asdf-aws-mfa-login/actions/workflows/lint.yml/badge.svg)](https://github.com/signavio/asdf-aws-mfa-login/actions/workflows/lint.yml)
3+
# asdf-xterrafile [![Build](https://github.com/signavio/asdf-xterrafile/actions/workflows/build.yml/badge.svg)](https://github.com/signavio/asdf-xterrafile/actions/workflows/build.yml) [![Lint](https://github.com/signavio/asdf-xterrafile/actions/workflows/lint.yml/badge.svg)](https://github.com/signavio/asdf-xterrafile/actions/workflows/lint.yml)
44

55

6-
[aws-mfa-login](https://github.com/signavio/aws-mfa-login) plugin for the [asdf version manager](https://asdf-vm.com).
6+
[xterrafile](https://github.com/signavio/xterrafile) plugin for the [asdf version manager](https://asdf-vm.com).
77

88
</div>
99

@@ -24,25 +24,25 @@
2424
Plugin:
2525

2626
```shell
27-
asdf plugin add aws-mfa-login
27+
asdf plugin add xterrafile
2828
# or
29-
asdf plugin add aws-mfa-login https://github.com/signavio/asdf-aws-mfa-login.git
29+
asdf plugin add xterrafile https://github.com/signavio/asdf-xterrafile.git
3030
```
3131

32-
aws-mfa-login:
32+
xterrafile:
3333

3434
```shell
3535
# Show all installable versions
36-
asdf list-all aws-mfa-login
36+
asdf list-all xterrafile
3737

3838
# Install specific version
39-
asdf install aws-mfa-login latest
39+
asdf install xterrafile latest
4040

4141
# Set a version globally (on your ~/.tool-versions file)
42-
asdf global aws-mfa-login latest
42+
asdf global xterrafile latest
4343

44-
# Now aws-mfa-login commands are available
45-
aws-mfa-login --version
44+
# Now xterrafile commands are available
45+
xterrafile --version
4646
```
4747

4848
Check [asdf](https://github.com/asdf-vm/asdf) readme for more instructions on how to
@@ -52,11 +52,11 @@ install & manage versions.
5252

5353
Contributions of any kind welcome! See the [contributing guide](contributing.md).
5454

55-
[Thanks goes to these contributors](https://github.com/signavio/asdf-aws-mfa-login/graphs/contributors)!
55+
[Thanks goes to these contributors](https://github.com/signavio/asdf-xterrafile/graphs/contributors)!
5656

5757
## Testing
5858
```bash
59-
asdf plugin-test aws-mfa-login https://github.com/signavio/asdf-aws-mfa-login --asdf-tool-version latest --asdf-plugin-gitref $(git rev-parse HEAD) aws-mfa-login --version
59+
asdf plugin-test xterrafile https://github.com/signavio/asdf-xterrafile --asdf-tool-version latest --asdf-plugin-gitref $(git rev-parse HEAD) xterrafile --version
6060
```
6161

6262

bin/download

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ source "${plugin_dir}/lib/utils.bash"
1111
mkdir -p "$ASDF_DOWNLOAD_PATH/bin"
1212

1313
# TODO: Adapt this to proper extension and adapt extracting strategy.
14-
release_file_extracted="$ASDF_DOWNLOAD_PATH/bin/$TOOL_NAME"
15-
release_file="${release_file_extracted}.gz"
14+
release_file="$ASDF_DOWNLOAD_PATH/bin/$TOOL_NAME.tar.gz"
1615

1716
# Download tar.gz file to the download directory
1817
download_release "$ASDF_INSTALL_VERSION" "$release_file"
1918

2019
# Extract contents of tar.gz file into the download directory
21-
gunzip -c "${release_file}" >"${release_file_extracted}" || fail "Could not extract $release_file"
22-
chmod +x "$release_file_extracted"
20+
tar -xzf "$release_file" -C "$ASDF_DOWNLOAD_PATH" || fail "Could not extract $release_file"
21+
ls -la "$release_file"
22+
chmod +x "$ASDF_DOWNLOAD_PATH/${TOOL_NAME}"
23+
ls -la "$ASDF_DOWNLOAD_PATH/${TOOL_NAME}"
2324

2425
# Remove the tar.gz file since we don't need to keep it
2526
rm "$release_file"

bin/install

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ plugin_dir=$(dirname "$(dirname "$current_script_path")")
88
# shellcheck source=../lib/utils.bash
99
source "${plugin_dir}/lib/utils.bash"
1010

11-
install_version "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH"
11+
install_version "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH/bin"

bin/list-all

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ plugin_dir=$(dirname "$(dirname "$current_script_path")")
88
# shellcheck source=../lib/utils.bash
99
source "${plugin_dir}/lib/utils.bash"
1010

11-
list_all_versions | sort_versions | xargs echo
11+
# tag 2.3.2 has no release
12+
list_all_versions | sort_versions | grep -v "2.3.2" | xargs echo

contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Testing Locally:
66
asdf plugin test <plugin-name> <plugin-url> [--asdf-tool-version <version>] [--asdf-plugin-gitref <git-ref>] [test-command*]
77

88
#
9-
asdf plugin test aws-mfa-login https://github.com/karlderkaefer/asdf-aws-mfa-login.git "aws-mfa-login --version"
9+
asdf plugin test xterrafile https://github.com/signavio/asdf-xterrafile.git "xterrafile --version"
1010
```
1111

1212
Tests are automatically run in GitHub Actions on push and PR.

lib/utils.bash

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
set -euo pipefail
44

5-
# TODO: Ensure this is the correct GitHub homepage where releases can be downloaded for aws-mfa-login.
6-
GH_REPO="https://github.com/signavio/aws-mfa-login"
7-
TOOL_NAME="aws-mfa-login"
8-
TOOL_TEST="aws-mfa-login --version"
5+
# TODO: Ensure this is the correct GitHub homepage where releases can be downloaded for xterrafile.
6+
GH_REPO="https://github.com/devopsmakers/xterrafile"
7+
TOOL_NAME="xterrafile"
8+
TOOL_TEST="xterrafile version"
99

1010
fail() {
1111
echo -e "asdf-$TOOL_NAME: $*"
@@ -14,7 +14,7 @@ fail() {
1414

1515
curl_opts=(-fsSL)
1616

17-
# NOTE: You might want to remove this if aws-mfa-login is not hosted on GitHub releases.
17+
# NOTE: You might want to remove this if xterrafile is not hosted on GitHub releases.
1818
if [ -n "${GITHUB_API_TOKEN:-}" ]; then
1919
curl_opts=("${curl_opts[@]}" -H "Authorization: token $GITHUB_API_TOKEN")
2020
fi
@@ -32,12 +32,12 @@ list_github_tags() {
3232

3333
list_all_versions() {
3434
# TODO: Adapt this. By default we simply list the tag names from GitHub releases.
35-
# Change this function if aws-mfa-login has other means of determining installable versions.
35+
# Change this function if xterrafile has other means of determining installable versions.
3636
list_github_tags
3737
}
3838

3939
download_release() {
40-
local version filename url platform arch
40+
local version filename url platform
4141

4242
version="$1"
4343
filename="$2"
@@ -47,14 +47,9 @@ download_release() {
4747
fail "Unsupported platform '${platform}' found. Only Linux and Darwin are supported."
4848
fi
4949

50-
case $(uname -m) in
51-
x86_64) arch="amd64" ;;
52-
arm64) arch="arm64" ;;
53-
esac
54-
55-
# TODO: Adapt the release URL convention for aws-mfa-login
56-
# https://github.com/signavio/aws-mfa-login/releases/download/v0.1.11/aws-mfa-login_darwin_amd64.gz
57-
url="$GH_REPO/releases/download/v${version}/${TOOL_NAME}_${platform}_${arch}.gz"
50+
# TODO: Adapt the release URL convention for xterrafile
51+
# https://github.com/devopsmakers/xterrafile/releases/download/v2.3.1/xterrafile_2.3.1_Darwin_x86_64.tar.gz
52+
url="$GH_REPO/releases/download/v${version}/${TOOL_NAME}_${version}_${platform}_x86_64.tar.gz"
5853

5954
echo "* Downloading $TOOL_NAME release $version..."
6055
curl "${curl_opts[@]}" -o "$filename" "$url" || fail "Could not download $url"
@@ -74,10 +69,10 @@ install_version() {
7469
echo "install path"
7570
cp -r "$ASDF_DOWNLOAD_PATH"/* "$install_path"
7671

77-
# TODO: Asert aws-mfa-login executable exists.
72+
# TODO: Asert xterrafile executable exists.
7873
local tool_cmd
7974
tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)"
80-
test -x "$install_path/bin/$tool_cmd" || fail "Expected $install_path/bin/$tool_cmd to be executable."
75+
test -x "$install_path/$tool_cmd" || fail "Expected $install_path/$tool_cmd to be executable."
8176

8277
echo "$TOOL_NAME $version installation was successful!"
8378
) || (

0 commit comments

Comments
 (0)