summaryrefslogtreecommitdiff
path: root/format-code.sh
blob: 9649a403993dbecad5d74dcd27ca620d5e4301e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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
# add much of this to the build script.
#

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