1#!/bin/bash 2# 3# Library used to refer to open source tools. 4 5set -o nounset 6set -o pipefail 7set -o errexit 8 9# NOTE: RAPPOR_SRC defined by the module that sources (cook.sh or ui.sh) 10 11# Caller can override shebang line by setting $DEP_PYTHON. 12readonly PYTHON=${DEP_PYTHON:-} 13 14readonly METRIC_STATUS=${DEP_METRIC_STATUS:-} 15 16 17# These 3 used by cook.sh. 18 19TOOLS-combine-status() { 20 if test -n "$PYTHON"; then 21 $PYTHON $RAPPOR_SRC/pipeline/combine_status.py "$@" 22 else 23 $RAPPOR_SRC/pipeline/combine_status.py "$@" 24 fi 25} 26 27TOOLS-combine-results() { 28 if test -n "$PYTHON"; then 29 $PYTHON $RAPPOR_SRC/pipeline/combine_results.py "$@" 30 else 31 $RAPPOR_SRC/pipeline/combine_results.py "$@" 32 fi 33} 34 35TOOLS-metric-status() { 36 if test -n "$METRIC_STATUS"; then 37 $METRIC_STATUS "$@" 38 else 39 $RAPPOR_SRC/pipeline/metric_status.R "$@" 40 fi 41} 42 43# Used by ui.sh. 44 45TOOLS-csv-to-html() { 46 if test -n "$PYTHON"; then 47 $PYTHON $RAPPOR_SRC/pipeline/csv_to_html.py "$@" 48 else 49 $RAPPOR_SRC/pipeline/csv_to_html.py "$@" 50 fi 51} 52 53# 54# Higher level scripts 55# 56 57TOOLS-cook() { 58 $RAPPOR_SRC/pipeline/cook.sh "$@" 59} 60 61# TODO: Rename gen-ui.sh. 62TOOLS-gen-ui() { 63 $RAPPOR_SRC/pipeline/ui.sh "$@" 64} 65