xref: /aosp_15_r20/development/tools/winscope/hooks/pre-upload (revision 90c8c64db3049935a07c6143d7fd006e26f8ecca)
1#!/bin/sh
2
3WINSCOPE_SRC_PATTERN="tools/winscope/"
4
5match=false
6for file in "$@"
7do
8  if echo $file | grep --quiet "$WINSCOPE_SRC_PATTERN"
9  then
10    match=true
11  fi
12done
13
14# If there are changes to winscope files and npm is installed
15if $match && (which node > /dev/null)
16then
17  echo "Running winscope presubmit tests..."
18  npm run test:presubmit --prefix $WINSCOPE_SRC_PATTERN
19fi
20