#!/usr/bin/env bash# Deeply inspired by https://github.com/Microsoft/vscode/blob/1.17.0/resources/linux/bin/code.sh# If root, ensure that --user-data-dir is specifiedif [ "$(id -u)" = "0" ]; thenfor i in $@doif [[ $i == --user-data-dir=* ]]; thenDATA_DIR_SET=1fidoneif [ -z $DATA_DIR_SET ]; thenecho "It is recommended to start hyper as a normal user. To run as root, you must specify an alternate user data directory with the --user-data-dir argument." 1>&2exit 1fifiif [ ! -L $0 ]; then# if path is not a symlink, find relativelyHYPER_PATH="$(dirname $0)/../.."elseif which readlink >/dev/null; then# if readlink exists, follow the symlink and find relativelyHYPER_PATH="$(dirname $(readlink -f $0))/../.."else# else use the standard install locationHYPER_PATH="/opt/Hyper"fifiELECTRON="$HYPER_PATH/hyper"CLI="$HYPER_PATH/resources/bin/cli.js"ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"exit $?