diff --git a/.tests/pre-commit-frontend.sh b/.tests/pre-commit-frontend.sh index b8c8266..cbc375f 100755 --- a/.tests/pre-commit-frontend.sh +++ b/.tests/pre-commit-frontend.sh @@ -1,8 +1,13 @@ #!/usr/bin/env bash -pwd -ls -lsah +$UI_DIR="hyperglass/ui" -cd hyperglass/ui +if git diff --cached --name-only | grep --quiet "$UI_DIR" +then + echo "No frontend files have changed, skipping pre-commit check..." + exit 0 +fi + +cd $UI_DIR yarn typecheck diff --git a/hyperglass/ui/nextdev.js b/hyperglass/ui/nextdev.js index 0c6bb31..05e6667 100644 --- a/hyperglass/ui/nextdev.js +++ b/hyperglass/ui/nextdev.js @@ -8,6 +8,7 @@ const config = require(String(configFile)); const { NODE_ENV: env, _HYPERGLASS_URL_: envUrl } = config; +// testing const devProxy = { '/api/query/': { target: envUrl + 'api/query/', pathRewrite: { '^/api/query/': '' } }, '/images': { target: envUrl + 'images', pathRewrite: { '^/images': '' } }, @@ -31,7 +32,7 @@ app // Set up the proxy. if (dev && devProxy) { - Object.keys(devProxy).forEach(function(context) { + Object.keys(devProxy).forEach(function (context) { server.use(proxyMiddleware(context, devProxy[context])); }); }