-
Notifications
You must be signed in to change notification settings - Fork 747
Expand file tree
/
Copy pathrisedev
More file actions
executable file
·42 lines (33 loc) · 1.56 KB
/
risedev
File metadata and controls
executable file
·42 lines (33 loc) · 1.56 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
#!/usr/bin/env bash
set -e
if [ -z "$(which cargo-binstall)" ] && [ -z "$RISINGWAVE_CI" ]; then
echo "Installing cargo-binstall..."
curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash
fi
if [ -z "$(which cargo-make)" ]; then
echo "Installing cargo-make..."
cargo binstall cargo-make@~0.37 --locked
fi
touch risedev-components.user.env
# RISEDEV_CMD might be set if it is installed to the PATH.
# Otherwise, we set it to the current script name.
if [ -z "$RISEDEV_CMD" ]; then
export RISEDEV_CMD="$0"
fi
if [ $# -eq 0 ] || [ "$1" == "-h" ] || [ "$1" == "--help" ]; then
cargo make --list-all-steps --hide-uninteresting
exit 0
fi
cargo make --silent --allow-private configure-if-not-configured
# WORKAROUND: `cargo make` does not handle SIGINT and will exit without waiting for the child processes
# to finish. This can be confusing and not friendly for users.
# Here we trap SIGINT to an empty command to ignore it, so that the consecutive `cargo make` will also
# ignore SIGINT. However, all child processes spawned by `cargo make` can still receive and handle SIGINT.
# As a result, `cargo make` will behave similar to `bash`.
# To test this, run `risedev psql`, press ^C, and compare the behavior with `cargo make psql`.
if [ "$1" == "psql" ] || [[ "$1" == slt* ]]; then
trap '' INT
fi
# We marked many tasks as private, so we can have a more concise output when listing all tasks.
# But we allow private tasks to be executed.
cargo make --allow-private "$@"