#!/usr/bin/env bash# Deeply inspired by https://github.com/Microsoft/vscode/blob/1.17.0/resources/win/bin/code.shNAME="Hyper"HYPER_PATH="$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")"ELECTRON="$HYPER_PATH/$NAME.exe"if grep -q Microsoft /proc/version; thenecho "Warning! Due to WSL limitations, you can't use CLI commands here. Please use Hyper CLI on cmd, PowerShell or GitBash/CygWin."echo "Please see: https://github.com/Microsoft/WSL/issues/1494"echo ""# If running under WSL don't pass cli.js to Electron, as environment vars# can't be transferred from WSL to Windows.# See: https://github.com/Microsoft/BashOnWindows/issues/1363# https://github.com/Microsoft/BashOnWindows/issues/1494"$ELECTRON" "$@"exit $?fiif [ "$(expr substr $(uname -s) 1 9)" == "CYGWIN_NT" ]; thenCLI=$(cygpath -m "$HYPER_PATH/resources/bin/cli.js")elseCLI="$HYPER_PATH/resources/bin/cli.js"fiELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"exit $?