Skip to content

Commit f5602a7

Browse files
committed
install replicated cli
1 parent 9c4a72b commit f5602a7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

applications/wg-easy/taskfiles/utils.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ tasks:
3131
3232
echo "Detected OS: $OS, Architecture: $ARCH"
3333
34+
# Create a temporary directory for extraction
35+
TEMP_DIR=$(mktemp -d)
36+
cd "$TEMP_DIR"
37+
3438
# Download and install based on OS
3539
if [ "$OS" = "linux" ]; then
3640
echo "Downloading Replicated CLI for Linux..."
@@ -41,7 +45,6 @@ tasks:
4145
4246
tar xzf replicated.tar.gz
4347
sudo mv replicated /usr/local/bin/replicated
44-
rm -f replicated.tar.gz
4548
4649
elif [ "$OS" = "darwin" ]; then
4750
echo "Downloading Replicated CLI for macOS..."
@@ -52,14 +55,19 @@ tasks:
5255
5356
tar xzf replicated.tar.gz
5457
sudo mv replicated /usr/local/bin/replicated
55-
rm -f replicated.tar.gz
5658
5759
else
5860
echo "Unsupported operating system: $OS"
5961
echo "Please install manually from: https://docs.replicated.com/reference/replicated-cli-installing"
62+
cd - >/dev/null
63+
rm -rf "$TEMP_DIR"
6064
exit 1
6165
fi
6266
67+
# Clean up temporary directory
68+
cd - >/dev/null
69+
rm -rf "$TEMP_DIR"
70+
6371
# Verify installation
6472
if command -v replicated >/dev/null 2>&1; then
6573
echo "Replicated CLI installed successfully!"

0 commit comments

Comments
 (0)