-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathjustfile_helpers
More file actions
29 lines (25 loc) · 919 Bytes
/
justfile_helpers
File metadata and controls
29 lines (25 loc) · 919 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
_lint version="" fmt-flag="" clippy-flag="":
cargo +nightly{{version}} fmt --all {{fmt-flag}}
cargo +nightly{{version}} clippy --all-targets -- {{clippy-flag}}
_doc version="":
cargo +nightly{{version}} doc --no-deps
# Log a message to stderr.
_log message:
@echo "-> [$(date +"%Y-%m-%d %H:%M:%S")] {{message}}" 1>&2;
# Wait for Stratus to start.
_wait_for_stratus port="3000":
#!/bin/bash
just _log "Waiting 600 seconds for Stratus on port {{port}} to start"
wait-service --tcp 0.0.0.0:{{port}} -t 600 -- echo
if [ $? -eq 0 ]; then
just _log "Stratus on port {{port}} started"
else
just _log "Stratus on port {{port}} did not start fast enough"
cat stratus.log
exit 255
fi
_wait_for_stratus_finish port="3000":
#!/bin/bash
while nc -z localhost {{port}}; do
sleep 0.1 # wait for 1/10 of the second before check again
done