-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathmain.sh
More file actions
executable file
·27 lines (21 loc) · 885 Bytes
/
main.sh
File metadata and controls
executable file
·27 lines (21 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/usr/bin/env bash
App="$(dirname "$0")/../.."
cd "$App";App="$PWD"
function denoNotFound () {
URL="file://$App/Contents/Resources/Deno not found Error.html"
URL="${URL// /%20}"
"$App/Contents/MacOS/appify-ui-webview" -url "${URL}"
exit 1
}
function installDeno () {
curl -fsSL https://deno.land/x/install/install.sh | sh
}
deno="$App/Contents/MacOS/deno" # for packaging deno with the app
[[ -f "$deno" ]] || deno="$HOME/.deno/bin/deno" # default install location
[[ -f "$deno" ]] || deno="`which deno`" # in PATH
[[ -f "$deno" ]] || installDeno
[[ -f "$deno" ]] || deno="$HOME/.deno/bin/deno" # default install location
[[ -f "$deno" ]] || deno="`which deno`" # in PATH
[[ -f "$deno" ]] || denoNotFound
MAIN="$App/Contents/Resources/app/main.ts"
"$deno" run --allow-read --allow-write --allow-net --allow-env --allow-run "$MAIN" "$@"