LightEdit mode launcher script fixes

- More accurate required utilities diagnostics
- Add "nosplash" argument

GitOrigin-RevId: 4911806122ac80fe52ad60467a4d0137cddd7d94
This commit is contained in:
Rustam Vishnyakov
2020-10-21 19:12:26 +00:00
committed by intellij-monorepo-bot
parent e76d4b5189
commit b99807b779
2 changed files with 55 additions and 6 deletions
@@ -1,7 +1,29 @@
#!/bin/sh
# ------------------------------------------------------
# __product_full__ LightEdit mode script.
# __product_full__ LightEdit mode Linux script.
# ------------------------------------------------------
message()
{
TITLE="Cannot start LightEdit mode script"
if [ -n "$(command -v notify-send)" ]; then
notify-send "ERROR: $TITLE" "$1"
else
printf "ERROR: %s\n%s\n" "$TITLE" "$1"
fi
}
IDE_BIN_HOME="$(dirname "$(realpath "$0")")"
exec "$IDE_BIN_HOME/__script_name__" -e "$@"
DIRNAME=$(command -v dirname)
if [ -z "$DIRNAME" ]; then
message "Required 'dirname' utility is missing in the system."
exit 1
fi
REALPATH=$(command -v realpath)
if [ -z "$REALPATH" ]; then
message "Required 'realpath' utility is missing in the system."
exit 1
fi
IDE_BIN_HOME="$("$DIRNAME" "$("$REALPATH" "$0")")"
exec "$IDE_BIN_HOME/__script_name__" nosplash -e "$@"
@@ -1,7 +1,34 @@
#!/bin/sh
# ------------------------------------------------------
# @@product_full@@ LightEdit mode script.
# @@product_full@@ LightEdit mode MacOS script.
# ------------------------------------------------------
IDE_BIN_HOME="${0%/*}"
exec "$IDE_BIN_HOME/../MacOS/@@script_name@@" -e "$@"
message() {
TITLE="Cannot start LightEdit mode script"
if [ -n "$(command -v osascript)" ]; then
osascript -e 'display alert "'"$TITLE"'" message "'"$1"'" as critical'
else
printf "ERROR: %s\n%s\n" "$TITLE" "$1"
fi
}
READLINK=$(command -v readlink)
if [ -z "$READLINK" ]; then
message "Required 'readlink' utility is missing in the system."
exit 1
fi
DIRNAME=$(command -v dirname)
if [ -z "$DIRNAME" ]; then
message "Required 'dirname' utility is missing in the system."
exit 1
fi
SCRIPT_LOC="$0"
while [ -L "$SCRIPT_LOC" ]; do
SCRIPT_LOC=$("$READLINK" "$SCRIPT_LOC")
done
IDE_BIN_HOME=$("$DIRNAME" "$SCRIPT_LOC")
exec "$IDE_BIN_HOME/../MacOS/@@script_name@@" nosplash -e "$@"