diff options
author | Patrick Williams <patrick@stwcx.xyz> | 2020-12-30 02:19:12 +0300 |
---|---|---|
committer | Yoshie Muranaka <yoshiemuranaka@gmail.com> | 2021-01-05 01:15:18 +0300 |
commit | 91f8ad36de0dc21dc93786b40e65a53a6b888807 (patch) | |
tree | 243ea16c024017a7ece7df57bafa9df255ab34c7 | |
parent | 0f22907a4163d6cb84c1cb7c024b09db888e88b2 (diff) | |
download | webui-vue-91f8ad36de0dc21dc93786b40e65a53a6b888807.tar.xz |
lint: update format-code script
Due to openbmc/openbmc-build-scripts@55448ad, format-code scripts are
now required to have a #!. Add one here.
Format-code scripts are also ran from an arbitrary directory but the
path to the root of the repository is passed as the first argument.
Switch to that directory so `npm` does the right thing.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ic15ef0af7d7ebd224762e9eaba41d3b92ce5e5bd
-rwxr-xr-x | format-code.sh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/format-code.sh b/format-code.sh index b490dd2a..9649a403 100755 --- a/format-code.sh +++ b/format-code.sh @@ -1,3 +1,4 @@ +#!/bin/bash # Run GUI Linting and Formatting as part of the CI Build process # # This is a short term solution. The long term solution to will be to @@ -6,6 +7,13 @@ set -e +# When called from openbmc-build-scripts, the `pwd` could be anywhere, but +# the root of the repo is passed in the first argument. Switch to the repo +# root so npm/git run in the right place. +if [ -n "$1" ]; then + cd "$1" +fi + npm ci npm run lint -git --no-pager diff --exit-code
\ No newline at end of file +git --no-pager diff --exit-code |