#!/usr/bin/env sh set -e # Adds a preedefined script tag including the merge current request id to the angular web app index.html. # This enables the interactive gitlab review toolbar. MERGE_REQUEST_ID="" if echo -n $3 | grep -Eq '[0-9]+$'; then MERGE_REQUEST_ID="$(echo -n "$3" | grep -Eo '[0-9]+$')" fi INDEX_PATH=$(dirname $1) SCRIPT_TAG="" curl https://gitlab.com/assets/webpack/visual_review_toolbar.js --output "$INDEX_PATH/visual_review_toolbar.js" --silent sed -i -e "\@@i\\$SCRIPT_TAG" $1