blob: b93ca626f4156ad44d7422726d3a173e199fa946 [file] [log] [blame]
Patrick Williams91f8ad32020-12-29 17:19:12 -06001#!/bin/bash
Derick Montaguebf2131f2020-05-29 11:21:36 -05002# 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
Patrick Williams91f8ad32020-12-29 17:19:12 -060010# 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
Ed Tanous02e14972024-02-27 12:59:56 -080017npm install
Derick Montaguebf2131f2020-05-29 11:21:36 -050018npm run lint
Ed Tanous02e14972024-02-27 12:59:56 -080019
20# CI might be running a different version of NPM than yocto, and we don't
21# want to trigger a formatting failure if package-lock.json has changed
22# Therefore, revert it back to what it was previously.
23git checkout package-lock.json
Patrick Williams91f8ad32020-12-29 17:19:12 -060024git --no-pager diff --exit-code