Skip to content

Commit f13a9d5

Browse files
Hespiangm42
andauthored
add --auto-run option to get-core.sh (#7)
* add --auto-run option to get-core.sh * print to stderr Co-authored-by: Giuseppe <[email protected]> --------- Co-authored-by: Giuseppe <[email protected]>
1 parent b4608dc commit f13a9d5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

get-core.sh

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22
# <h2 style="color:red">Get Firebolt Core with:</h2><code>bash <(curl -s https://get-core.firebolt.io/)</code><br/><br/><br/><pre>
33
set -e
44

5+
# Parse command line arguments
6+
AUTO_RUN=false
7+
if [ "$1" = "--auto-run" ]; then
8+
AUTO_RUN=true
9+
elif [ -n "$1" ]; then
10+
echo "Unknown option: $1"
11+
echo "Usage: $0 [--auto-run]" 1>&2
12+
exit 1
13+
fi
14+
515
banner() {
616
echo "
717
🔥🔥🔥 Firebolt Core setup script 🔥🔥🔥
@@ -53,7 +63,13 @@ pull_docker_image() {
5363

5464
run_docker_image() {
5565
echo "[⚠️] Note: a local 'firebolt-core-data directory' will be created."
56-
read -p "[🔥] Everything is set up and you are ready to go! Do you want to run the Firebolt Core image? [y/N]: " answer
66+
67+
if [ "$AUTO_RUN" = true ]; then
68+
answer="y"
69+
else
70+
read -p "[🔥] Everything is set up and you are ready to go! Do you want to run the Firebolt Core image? (use --auto-run to skip this prompt) [y/N]: " answer
71+
fi
72+
5773
case "$answer" in
5874
[yY])
5975
echo "[🔥] Running a Firebolt Core Docker container"

0 commit comments

Comments
 (0)