Skip to content

Commit 48c2ab8

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

File tree

1 file changed

+6
-46
lines changed

1 file changed

+6
-46
lines changed

scripts/deb-after-install.sh

Lines changed: 6 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -19,62 +19,22 @@ if [ -f "$DESKTOP_FILE" ]; then
1919
sudo sed -i "s|$OLD_INSTALL_PATH|$NEW_INSTALL_PATH|g" "$DESKTOP_FILE"
2020
fi
2121

22+
# Create the simplest possible launcher script
2223
sudo tee /usr/bin/redisinsight > /dev/null << 'EOF'
2324
#!/bin/bash
2425
25-
# Log file for debugging
26-
LOG_FILE="/tmp/redisinsight-launcher.log"
26+
cd "/opt/Redis Insight" || exit 1
2727
28-
# Find the real binary
29-
INSTALL_DIR="/opt/Redis Insight"
30-
31-
# Function to write to log
32-
log() {
33-
echo "$(date): $1" >> "$LOG_FILE"
34-
}
35-
36-
# Start with a clean log
37-
echo "$(date): Launcher started" > "$LOG_FILE"
38-
log "Args: $@"
39-
40-
# Check if the original redisinsight is a script or binary
41-
file_type=$(file -b "$INSTALL_DIR/redisinsight" 2>/dev/null)
42-
log "File type: $file_type"
43-
44-
# Detect Electron apps
45-
if [ -f "$INSTALL_DIR/resources/electron" ]; then
46-
ELECTRON_PATH="$INSTALL_DIR/resources/electron"
47-
log "Found Electron at: $ELECTRON_PATH"
48-
49-
if [ -d "$INSTALL_DIR/resources/app" ]; then
50-
APP_PATH="$INSTALL_DIR/resources/app"
51-
log "Found app directory at: $APP_PATH"
52-
cd "$INSTALL_DIR" && exec "$ELECTRON_PATH" "$APP_PATH" "$@"
53-
exit $?
54-
else
55-
log "No app directory found, executing electron directly"
56-
cd "$INSTALL_DIR" && exec "$ELECTRON_PATH" "$@"
57-
exit $?
58-
fi
59-
elif [ -f "$INSTALL_DIR/redisinsight" ]; then
60-
# Execute the original but avoid PATH search
61-
log "Executing original binary with absolute path"
62-
cd "$INSTALL_DIR" && exec ./redisinsight.real "$@"
63-
exit $?
64-
else
65-
log "ERROR: Could not find executable"
66-
echo "Error: Could not find RedisInsight executable" >&2
67-
exit 1
68-
fi
28+
echo "Launching RedisInsight with args: $@"
29+
./redisinsight "$@"
6930
EOF
7031

7132
# Make the launcher script executable
7233
sudo chmod +x /usr/bin/redisinsight
7334

74-
# Rename the original to avoid name collision in PATH
35+
# Ensure the original is executable
7536
if [ -f "$OLD_INSTALL_PATH/redisinsight" ]; then
76-
sudo mv "$OLD_INSTALL_PATH/redisinsight" "$OLD_INSTALL_PATH/redisinsight.real"
77-
sudo chmod +x "$OLD_INSTALL_PATH/redisinsight.real"
37+
sudo chmod +x "$OLD_INSTALL_PATH/redisinsight"
7838
fi
7939

8040
# Set correct ownership and permissions for chrome-sandbox (on the original location)

0 commit comments

Comments
 (0)