@@ -3,36 +3,26 @@ set -ex
3
3
4
4
# Define paths
5
5
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
15
6
16
- # Update desktop file to use new path
7
+ # Update desktop file to use executable path
8
+ DESKTOP_FILE=" /usr/share/applications/redisinsight.desktop"
17
9
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 "
20
12
fi
21
13
22
- # Create the simplest possible launcher script
14
+ # Create simple launcher script that directly uses full path
23
15
sudo tee /usr/bin/redisinsight > /dev/null << 'EOF '
24
16
#!/bin/bash
25
17
26
- cd "/opt/Redis Insight" || exit 1
27
-
28
18
echo "Launching RedisInsight with args: $@"
29
- ./ redisinsight "$@"
19
+ exec "/opt/Redis Insight/ redisinsight" "$@"
30
20
EOF
31
21
32
22
# Make the launcher script executable
33
23
sudo chmod +x /usr/bin/redisinsight
34
24
35
- # Ensure the original is executable
25
+ # Set basic executable permissions (on the original location)
36
26
if [ -f " $OLD_INSTALL_PATH /redisinsight" ]; then
37
27
sudo chmod +x " $OLD_INSTALL_PATH /redisinsight"
38
28
fi
0 commit comments