Skip to content

Commit c0cb041

Browse files
author
KIvanow
committed
RI-6690 even simpler script
1 parent 48c2ab8 commit c0cb041

File tree

1 file changed

+7
-17
lines changed

1 file changed

+7
-17
lines changed

scripts/deb-after-install.sh

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,36 +3,26 @@ set -ex
33

44
# Define paths
55
OLD_INSTALL_PATH="/opt/Redis Insight" # Path with space
6-
NEW_INSTALL_PATH="/opt/redisinsight" # New path without space
7-
DESKTOP_FILE="/usr/share/applications/redisinsight.desktop"
8-
9-
# Create a symlink instead of moving files
10-
if [ -d "$OLD_INSTALL_PATH" ] && [ ! -e "$NEW_INSTALL_PATH" ]; then
11-
echo "Creating symlink from $NEW_INSTALL_PATH to $OLD_INSTALL_PATH"
12-
# Create the symlink from new location to the old one
13-
sudo ln -sf "$OLD_INSTALL_PATH" "$NEW_INSTALL_PATH"
14-
fi
156

16-
# Update desktop file to use new path
7+
# Update desktop file to use executable path
8+
DESKTOP_FILE="/usr/share/applications/redisinsight.desktop"
179
if [ -f "$DESKTOP_FILE" ]; then
18-
echo "Updating desktop file to use new path"
19-
sudo sed -i "s|$OLD_INSTALL_PATH|$NEW_INSTALL_PATH|g" "$DESKTOP_FILE"
10+
echo "Updating desktop file to use executable path"
11+
sudo sed -i "s|Exec=.*|Exec=/usr/bin/redisinsight|g" "$DESKTOP_FILE"
2012
fi
2113

22-
# Create the simplest possible launcher script
14+
# Create simple launcher script that directly uses full path
2315
sudo tee /usr/bin/redisinsight > /dev/null << 'EOF'
2416
#!/bin/bash
2517
26-
cd "/opt/Redis Insight" || exit 1
27-
2818
echo "Launching RedisInsight with args: $@"
29-
./redisinsight "$@"
19+
exec "/opt/Redis Insight/redisinsight" "$@"
3020
EOF
3121

3222
# Make the launcher script executable
3323
sudo chmod +x /usr/bin/redisinsight
3424

35-
# Ensure the original is executable
25+
# Set basic executable permissions (on the original location)
3626
if [ -f "$OLD_INSTALL_PATH/redisinsight" ]; then
3727
sudo chmod +x "$OLD_INSTALL_PATH/redisinsight"
3828
fi

0 commit comments

Comments
 (0)