Viktar Donich | 508f81d | 2018-12-21 15:12:27 -0800 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | if [[ -z "$1" ]]; then |
| 4 | echo This script injects plugins for *.googlesource.com. |
| 5 | echo Provide plugin paths, comma-separated, as a parameter. |
| 6 | echo This script assumes files do not have dependencies, i.e. minified. |
| 7 | exit 1 |
| 8 | fi |
| 9 | |
| 10 | realpath() { |
| 11 | [[ $1 = /* ]] && echo "$1" || echo "$PWD/${1#./}" |
| 12 | } |
| 13 | |
| 14 | join () { |
| 15 | local IFS="$1" |
| 16 | shift |
| 17 | echo "$*" |
| 18 | } |
| 19 | |
| 20 | plugins=$1 |
| 21 | plugin_paths=() |
| 22 | for plugin in $(echo ${plugins} | sed "s/,/ /g") |
| 23 | do |
| 24 | plugin_paths+=($(realpath ${plugin})) |
| 25 | done |
| 26 | |
| 27 | absolute_plugin_paths=$(join , "${plugin_paths[@]}") |
| 28 | |
| 29 | mitm_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" |
| 30 | |
| 31 | ${mitm_dir}/dev-chrome.sh & |
| 32 | |
Viktar Donich | fc299bc | 2019-04-08 13:03:10 -0700 | [diff] [blame] | 33 | bazel build //polygerrit-ui/app:test_components & |
| 34 | |
| 35 | ${mitm_dir}/mitm-docker.sh \ |
| 36 | "serve-app-dev.py \ |
| 37 | --plugins ${absolute_plugin_paths} \ |
| 38 | --strip_assets \ |
| 39 | --components $(pwd)/bazel-bin/polygerrit-ui/app/" |