Skip to content

Commit 889829b

Browse files
committed
Initial customisation of the plugin
1 parent fc29d0a commit 889829b

File tree

6 files changed

+61
-53
lines changed

6 files changed

+61
-53
lines changed

bin/download

Lines changed: 0 additions & 23 deletions
This file was deleted.

bin/help.links

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
echo "\
6+
Git Repository: https://github.com/infrablocks/pkl_aws_secret_resource_reader"

bin/help.overview

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
echo "\
6+
This plugin installs the pkl_aws_secret_resource_reader command which is a plugin to allow you to include secrets from AWS secrets manager into Pkl code."

bin/install

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

11+
install_version() {
12+
local install_type="$1"
13+
local install_version="$2"
14+
local install_path="$3"
15+
16+
if [ "$install_type" == "ref" ]; then
17+
return 1
18+
fi
19+
20+
os_type=$(uname -s)
21+
case "$os_type" in
22+
Darwin)
23+
os_type="macos"
24+
;;
25+
Linux)
26+
os_type="linux"
27+
;;
28+
*)
29+
echo "Unsupported OS: $os_type"
30+
exit 1
31+
;;
32+
esac
33+
arch_type=$(uname -m)
34+
case "$arch_type" in
35+
x86_64)
36+
arch_type="amd64"
37+
;;
38+
arm64)
39+
arch_type="aarch64"
40+
;;
41+
*)
42+
echo "Unsupported architecture: $arch_type"
43+
exit 1
44+
;;
45+
esac
46+
47+
mkdir -p "$install_path/bin"
48+
curl -s -L -o "$install_path/bin/pkl_aws_secret_resource_reader" "https://github.com/infrablocks/pkl_aws_secret_resource_reader/releases/download/v${install_version}/pkl_aws_secret_resource_reader-${os_type}-${arch_type}"
49+
chmod +x "$install_path/bin/pkl_aws_secret_resource_reader"
50+
return 0
51+
}
52+
1153
install_version "$ASDF_INSTALL_TYPE" "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH"

bin/latest-stable

Lines changed: 0 additions & 29 deletions
This file was deleted.

bin/list-all

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,10 @@ 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+
list_all_versions() {
12+
git ls-remote --tags --refs https://github.com/infrablocks/pkl_aws_secret_resource_reader.git |
13+
awk '!/({})/ {print $2}' |
14+
cut -f3 -d/
15+
}
16+
17+
list_all_versions | grep -v "v0.0.0" | xargs echo

0 commit comments

Comments
 (0)