Message ID | 20181103011048.73864-1-s@ricketyspace.net |
---|---|
State | Accepted |
Headers | show |
Series | Add auto yes/no switch to guix-install.sh | expand |
Context | Check | Description |
---|---|---|
cbaines/applying patch | success | Successfully applied |
cbaines/applying patch | success | Successfully applied |
Hi, > + # process -y / -n arg. > + export AUTO_YN=${1:1:1} > + if [ -z $AUTO_YN ]; then > + export AUTO_YN="" > + fi Why "export" ? Now all the child processes get it, making their environment different from before. This makes parse_args have system-wide side effects. If we wanted to export it, we could do it explicitly after parse_args has been called.
diff --git a/etc/guix-install.sh b/etc/guix-install.sh index cf839c20e..d16f8ac59 100755 --- a/etc/guix-install.sh +++ b/etc/guix-install.sh @@ -370,6 +370,21 @@ sys_authorize_build_farms() done } +parse_args() +{ + local args_num=$# + + if [ $args_num -lt 1 ]; then + return + fi + + # process -y / -n arg. + export AUTO_YN=${1:1:1} + if [ -z $AUTO_YN ]; then + export AUTO_YN="" + fi +} + welcome() { cat<<"EOF"