This commit is contained in:
Mariano Z. 2025-04-21 12:07:24 -03:00
commit b4cdb80b5c
Signed by: marianozunino
GPG key ID: 4C73BAD25156DACE
137 changed files with 6383 additions and 0 deletions

50
bin/.bin/redis.sh Executable file
View file

@ -0,0 +1,50 @@
#!/bin/bash
# Define paths
bin_dir=~/.bin
bin_file="${bin_dir}/redis"
# Create directory if it doesn't exist
mkdir -p "${bin_dir}"
# Set current working directory
cd "${bin_dir}"
if [ ! -f "${bin_file}" ]; then
notify-send -u normal "⏬ Redis Desktop Manager" "Downloading..."
# Get latest release info and parse with proper JSON handling
release_info=$(curl -s https://api.github.com/repos/qishibo/AnotherRedisDesktopManager/releases/latest)
# Determine system architecture
arch=$(uname -m)
if [ "${arch}" = "x86_64" ]; then
arch_pattern="x86_64"
elif [ "${arch}" = "aarch64" ]; then
arch_pattern="arm64"
else
echo "Unsupported architecture: ${arch}"
exit 1
fi
# Find appropriate AppImage for this architecture
filename=$(echo "${release_info}" | jq -r ".assets[].name" | grep "AppImage" | grep "${arch_pattern}")
echo "Selected filename: ${filename}"
# Get download URL
fileurl=$(echo "${release_info}" | jq -r --arg filename "${filename}" '.assets[] | select(.name == $filename) | .browser_download_url')
echo "Download URL: ${fileurl}"
# Download and make executable
if [ -n "${fileurl}" ] && [ "${fileurl}" != "null" ]; then
wget -q --show-progress -O "${bin_file}" "${fileurl}"
chmod +x "${bin_file}"
echo "Successfully downloaded Redis Desktop Manager"
else
echo "Failed to find download URL for architecture: ${arch}"
exit 1
fi
fi
# Execute with parameters if provided
"${bin_file}" -f ${1:+"-i"} ${1:+"$1"} ${2:+"-o"} ${2:+"$2"}