-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainw
More file actions
executable file
·30 lines (26 loc) · 796 Bytes
/
mainw
File metadata and controls
executable file
·30 lines (26 loc) · 796 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
28
29
30
#!/bin/sh
# Based on https://github.com/jcbhmr/deno_wrapper
set -e
# https://stackoverflow.com/a/29835459
script_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)
deno_dir="$script_dir/.deno"
# https://manpages.ubuntu.com/manpages/kinetic/en/man1/chronic.1.html
chronic() (
set +e
output=$($@ 2>&1)
exit_code=$?
set -e
if [ "$exit_code" -ne 0 ]; then
echo "$output" >&2
fi
return "$exit_code"
)
if [ ! -d "$deno_dir" ]; then
# https://github.com/denoland/deno_install#readme
export DENO_INSTALL=$deno_dir
curl -fsSL https://deno.land/x/install/install.sh | chronic sh -s "v1.36.0"
fi
# https://github.com/denoland/deno_install/blob/master/install.sh#L53
export DENO_INSTALL=$deno_dir
export PATH="$DENO_INSTALL/bin:$PATH"
exec deno run -A "$script_dir/main.ts" "$@"