xref: /openbmc/webui-vue/format-code.sh (revision d4ebc2a7)
1#!/bin/bash
2# Run GUI Linting and Formatting as part of the CI Build process
3#
4# This is a short term solution. The long term solution to will be to
5# add much of this to the build script.
6#
7
8set -e
9
10# When called from openbmc-build-scripts, the `pwd` could be anywhere, but
11# the root of the repo is passed in the first argument.  Switch to the repo
12# root so npm/git run in the right place.
13if [ -n "$1" ]; then
14    cd "$1"
15fi
16
17npm ci
18npm run lint
19git --no-pager diff --exit-code
20