-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
65 lines (61 loc) · 1.68 KB
/
Taskfile.yml
File metadata and controls
65 lines (61 loc) · 1.68 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
version: '3'
vars:
project_name: 'docs.solbond.co'
tasks:
default:
desc: List available tasks.
silent: true
cmds:
- task --list
setup:
desc: Install project dependencies with Bun.
silent: true
cmds:
- |
set -euo pipefail
if ! command -v bun >/dev/null 2>&1; then
echo "Bun runtime not found in PATH." >&2
echo "Install it via https://bun.sh/docs/installation" >&2
exit 1
fi
bun --version >/dev/null
tmp_log="$(mktemp)"
cleanup() {
rm -f "$tmp_log"
}
trap cleanup EXIT
( bun install --frozen-lockfile >"$tmp_log" 2>&1 ) &
bun_pid=$!
spinner='|/-\'
i=0
printf 'Installing dependencies '
while kill -0 "$bun_pid" >/dev/null 2>&1; do
printf '\rInstalling dependencies %s' "${spinner:i++%${#spinner}:1}"
sleep 0.1
done
wait "$bun_pid"
status=$?
printf '\r\033[K'
if [ "$status" -ne 0 ]; then
cat "$tmp_log" >&2
exit "$status"
fi
trap - EXIT
cleanup
printf '✔️ you are setup\n'
dev:
desc: Start the Next.js dev server with Bun.
silent: true
cmds:
- |
set -euo pipefail
if ! command -v bun >/dev/null 2>&1; then
echo "Bun runtime not found in PATH."
echo "Install it via https://bun.sh/docs/installation"
exit 1
fi
if [ ! -d node_modules ]; then
echo "node_modules missing; running 'bun install --frozen-lockfile'."
bun install --frozen-lockfile
fi
bun run dev{{if .CLI_ARGS}} {{.CLI_ARGS}}{{end}}