commit | b5e78091492e03351e6140675040cd1b8bcc7a10 | [log] [tgz] |
---|---|---|
author | Andrew Jeffery <andrew@aj.id.au> | Mon May 17 11:53:13 2021 +0930 |
committer | Andrew Jeffery <andrew@aj.id.au> | Mon May 17 12:27:01 2021 +0930 |
tree | 3d4bd67bd13a43cc719ce9894926439ee45bfa38 | |
parent | 1230660d409e55efe810504e30d598cab8496f0f [diff] |
format-code: Fix formatting failures There's a lengthy comment in the custom script as to why it needs to exist, and given it does, make it work. At some point the build scripts started passing the directory whose code should be formatted as the first argument to format-code.sh[1]. When format-code.sh is invoked, the working directory remains the workspace directory, so make our custom script change into the repo in order for the git commands to work. [1] https://github.com/openbmc/openbmc-build-scripts/blob/cd9578b262fcce6f1e4e3f76fa05fa5f56100123/scripts/unit-test.py#L1221 Change-Id: I34cb9dacb0270afadab0b8f138df80446bce63a2 Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
diff --git a/format-code.sh b/format-code.sh index 0f67180..1eb2232 100755 --- a/format-code.sh +++ b/format-code.sh
@@ -4,6 +4,11 @@ set -x +if [ $# -ge 1 ] +then + cd "$1" +fi + [ -f .clang-format ] && rm .clang-format # Use the provided clang-format, only define a version