mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Remove python dependency in cli on macOS
This commit is contained in:
parent
5adace6fe5
commit
bad6bd8790
1 changed files with 22 additions and 3 deletions
|
|
@ -1,8 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
# Deeply inspired by https://github.com/Microsoft/vscode/blob/1.17.0/resources/darwin/bin/code.sh
|
||||
# Deeply inspired by https://github.com/Microsoft/vscode/blob/1.65.2/resources/darwin/bin/code.sh
|
||||
|
||||
function realpath() { /usr/bin/python -c "import os,sys; print(os.path.realpath(sys.argv[1]))" "$0"; }
|
||||
CONTENTS="$(dirname "$(dirname "$(dirname "$(realpath "$0")")")")"
|
||||
# TODO: bash is deprecated on macOS and will be removed.
|
||||
# Port this to /bin/sh or /bin/zsh
|
||||
|
||||
function app_realpath() {
|
||||
SOURCE=$1
|
||||
while [ -h "$SOURCE" ]; do
|
||||
DIR=$(dirname "$SOURCE")
|
||||
SOURCE=$(readlink "$SOURCE")
|
||||
[[ $SOURCE != /* ]] && SOURCE=$DIR/$SOURCE
|
||||
done
|
||||
SOURCE_DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||
echo "${SOURCE_DIR%%"${SOURCE_DIR#*.app}"}"
|
||||
}
|
||||
|
||||
APP_PATH="$(app_realpath "${BASH_SOURCE[0]}")"
|
||||
if [ -z "$APP_PATH" ]; then
|
||||
echo "Unable to determine app path from symlink : ${BASH_SOURCE[0]}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CONTENTS="$APP_PATH/Contents"
|
||||
ELECTRON="$CONTENTS/MacOS/Hyper"
|
||||
CLI="$CONTENTS/Resources/bin/cli.js"
|
||||
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
|
||||
|
|
|
|||
Loading…
Reference in a new issue