Skip to content

Commit

Permalink
Auto-downloader
Browse files Browse the repository at this point in the history
  • Loading branch information
krystian-panek-vmltech committed Dec 12, 2022
1 parent 6b59bd4 commit ce3125e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ archives:
replacements:
386: i386
amd64: x86_64
# format_overrides:
# - goos: windows
# format: zip

checksum:
name_template: 'checksums.txt'
Expand Down
24 changes: 12 additions & 12 deletions aemw
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@

# Download tool

# use specific one 'vX.Y.Z' or just 'latest'
VERSION=v0.5.1
VERSION=0.5.2
OS="darwin"
ARCH="arm64"

EXECUTABLE_ZIP_URL="https://github.com/wttech/aemc/releases/$VERSION/download/aemc-cli_${OS}_${ARCH}.tar.gz"
EXECUTABLE_DIR="bin/aemc-cli/$VERSION"
EXECUTABLE_ZIP_PATH="$EXECUTABLE_DIR/aemc-cli.tar.gz"
EXECUTABLE_PATH="$EXECUTABLE_DIR/aemc-cli/aemc-cli"
TOOL_DOWNLOAD_URL="https://github.com/wttech/aemc/releases/download/v${VERSION}/aemc-cli_${OS}_${ARCH}.tar.gz"
TOOL_BIN_ROOT="bin/aemw/$VERSION"
TOOL_BIN_ARCHIVE_FILE="$TOOL_BIN_ROOT/aemc-cli.tar.gz"
TOOL_BIN_ARCHIVE_DIR="$TOOL_BIN_ROOT/aemc-cli"
TOOL_BIN_EXEC_FILE="$TOOL_BIN_ARCHIVE_DIR/aemc-cli"

if [ ! -f "$EXECUTABLE_PATH" ]; then
mkdir -p $EXECUTABLE_DIR
curl -o "$EXECUTABLE_ZIP_PATH" -OJL "$EXECUTABLE_ZIP_URL"
# TODO unpack
#chmod +x "$EXECUTABLE_PATH"
if [ ! -f "$TOOL_BIN_EXEC_FILE" ]; then
mkdir -p "$TOOL_BIN_ARCHIVE_DIR"
curl -o "$TOOL_BIN_ARCHIVE_FILE" -OJL "$TOOL_DOWNLOAD_URL"
tar -xvf "$TOOL_BIN_ARCHIVE_FILE" -C "$TOOL_BIN_ARCHIVE_DIR"
chmod +x "$TOOL_BIN_EXEC_FILE"
fi

# Declare provisioning API

# shellcheck disable=SC2139
alias aem="./$EXECUTABLE_PATH"
alias aem="./$TOOL_BIN_EXEC_FILE"

# print provisioning step header
step () {
Expand Down

0 comments on commit ce3125e

Please sign in to comment.