summarylogtreecommitdiffstats
path: root/setup-unattended.patch
blob: 5c98ca944db7d34428d7abe6626c7f42b0d2176b (plain)
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
--- setup.sh	2020-02-29 21:30:32.862816400 -0500
+++ setup.sh	2020-02-29 21:36:28.300273309 -0500
@@ -7,7 +7,7 @@
 target_sdk_dir=""
 post_install_cleanup=1
 confirm=0
-rc_confirm=0
+rc_confirm=""
 
 usage () {
   cat << EOF
@@ -24,6 +24,9 @@
   -y
         Automatic yes to prompts; assume "yes" as answer to all prompts.
 
+  -[no]rc
+	Whether to create/update the ~/.zerphyrc file (prompt if not given)
+
 EOF
 }
 
@@ -70,6 +73,12 @@
 			confirm="y";
 			rc_confirm="y";
 			;;
+		-rc )
+			rc_confirm="y";
+			;;
+		-norc )
+			rc_confirm="n";
+			;;
 		* )
 			echo "Error: Invalid argument \"$1\""
 			usage
@@ -120,7 +129,7 @@
 	echo "     export ZEPHYR_TOOLCHAIN_VARIANT=zephyr"
 	echo "     export ZEPHYR_SDK_INSTALL_DIR=$target_sdk_dir"
 	echo
-	if [ "$rc_confirm" != "y" ]; then
+	if [ -z "$rc_confirm" ]; then
 		echo "Update/Create $HOME/.zephyrrc with environment variables setup for you (y/n)? "
 		while read rc_confirm; do
 			[ "$rc_confirm" = "Y" -o "$rc_confirm" = "y" \