Skip to content

Commit

Permalink
Localised target directories to be within APP_ROOT
Browse files Browse the repository at this point in the history
  • Loading branch information
DrizzlyOwl committed Jan 31, 2025
1 parent ae248c8 commit 1e2fd43
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ bin/custom/v2/*
!bin/custom/v2/.gitkeep

Brewfile.lock.json
bin/session-manager-plugin
13 changes: 8 additions & 5 deletions lib/bash-functions/install_session_manager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,32 @@ function install_session_manager {
ARCH+="_$(uname -m)"
fi

TMP_DIR="$APP_ROOT/tmp"
BIN_DIR="$APP_ROOT/bin"

SESSION_MANAGER_ZIP="$BASE_URI/$ARCH/sessionmanager-bundle.zip"
SESSION_MANAGER_INSTALL_DIR="$HOME/Applications/session-manager-plugin"

log_info -l "Installing AWS Session Manager Plugin into $SESSION_MANAGER_INSTALL_DIR" -q "$QUIET_MODE"

# Grab the installer...
mkdir -p "$SESSION_MANAGER_INSTALL_DIR"
curl -fsSL "$SESSION_MANAGER_ZIP" -o "$HOME/Downloads/session-manager-plugin.zip"
unzip -o "$HOME/Downloads/session-manager-plugin.zip" -d "$SESSION_MANAGER_INSTALL_DIR"
curl -fsSL "$SESSION_MANAGER_ZIP" -o "$TMP_DIR/session-manager-plugin.zip"
unzip -o "$TMP_DIR/session-manager-plugin.zip" -d "$SESSION_MANAGER_INSTALL_DIR"

# Run the installer...
"$SESSION_MANAGER_INSTALL_DIR/sessionmanager-bundle/install" --install-dir "$SESSION_MANAGER_INSTALL_DIR" -b "$HOME/.bin/session-manager-plugin"
"$SESSION_MANAGER_INSTALL_DIR/sessionmanager-bundle/install" --install-dir "$SESSION_MANAGER_INSTALL_DIR" -b "$BIN_DIR/session-manager-plugin"

# Cleanup..
rm "$HOME/Downloads/session-manager-plugin.zip"
rm "$TMP_DIR/session-manager-plugin.zip"
rm -rf "$SESSION_MANAGER_INSTALL_DIR/sessionmanager-bundle"

# Try it for a nice confirmation message
if ! is_installed "session-manager-plugin";
then
echo "Add 'session-manager-plugin' to your \$PATH by running:"
echo
echo " export PATH=\"\$PATH:\$HOME/.bin/\""
echo " export PATH=\"\$PATH:$BIN_DIR\""
exit 1
else
session-manager-plugin
Expand Down

0 comments on commit 1e2fd43

Please sign in to comment.