From 96645d7ea7ef4233269f2d69097de958ecb12e1f Mon Sep 17 00:00:00 2001 From: Avi Zurel Date: Tue, 21 Jan 2020 18:28:06 -0800 Subject: [PATCH] website: Better example for running 0.12upgrade across many directories at once --- website/docs/commands/0.12upgrade.html.markdown | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/website/docs/commands/0.12upgrade.html.markdown b/website/docs/commands/0.12upgrade.html.markdown index c5d292650..3783be54e 100644 --- a/website/docs/commands/0.12upgrade.html.markdown +++ b/website/docs/commands/0.12upgrade.html.markdown @@ -99,9 +99,17 @@ are not supported by the tool itself, but if you are on a Unix-style system you can achieve this using the `find` command as follows: ``` -find . -name '*.tf' -printf "%h\n" | xargs -n1 terraform 0.12upgrade -yes +find . -name '*.tf' -printf "%h\n" | uniq | xargs -n1 terraform 0.12upgrade -yes ``` +On Mac OS X, the `find` included with the system does not support the `-printf` argument. You can install GNU find using Homebrew in order to use that argument: + +``` +brew install findutils +``` +Once installed, run the above command line using `gfind` instead of `find`. + + Note that the above includes the `-yes` option to override the interactive prompt, so be sure you have a clean work tree before running it.