From 2d7d90f8cefb7c476ee059d30374d4f75612c2d5 Mon Sep 17 00:00:00 2001 From: Andy George Date: Tue, 13 Jun 2023 13:13:05 -0500 Subject: [PATCH] fix(install.sh): Correctly `shift` all parsed arguments (#17684) Closes #17681 Without `shift`ing the other possible input arguments, the `--prefix` argument will set the `prefix` incorrectly. When using [the official Docker example](https://vector.dev/docs/setup/installation/#installation-script), arguments of `-y --prefix` will result in the following error: ``` mkdir: unrecognized option '--prefix' ``` ...as `"$2"` is `--prefix`, because `-y` was never `shift`ed out. Adding a `shift` to the other arguments correctly removes them from the argument list when parsed. --- distribution/install.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/distribution/install.sh b/distribution/install.sh index bbca042d0e4c1..e2903c7b11e7e 100755 --- a/distribution/install.sh +++ b/distribution/install.sh @@ -76,9 +76,11 @@ main() { ;; --no-modify-path) modify_path=no + shift ;; -y) prompt=no + shift ;; *) ;;