#!/bin/bash

set -euo pipefail

OUT_FILE=$1

BASE_FOLDER=$(dirname "$0")
HTML_CONTENT=$(cat "$BASE_FOLDER/0-test-report.html" | sed 's/\"/\\"/g' |sed 's/^.\{1,\}$/"&\\n"/' )

cat > "$OUT_FILE" <<- TEMPLATE
//  Copyright 2016 LinkedIn Corporation
//  Licensed under the BSD 2-Clause License (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at https://opensource.org/licenses/BSD-2-Clause
//
//  Unless required by applicable law or agreed to in writing, software
//  distributed under the License is distributed on an "AS IS" BASIS,
//  WITHOUT WARRANTIES OF ANY KIND, either express or implied.  See the License for the specific language governing permissions and limitations under the License.

// NOTE: This file is generated by ./scripts/html_header.sh, do NOT edit
#ifndef BPTestReportHTML_h
#define BPTestReportHTML_h

// Leaving this html content as source instead of resouce since Bluepill is a CLI tool with no resource bundles
static const NSString * const kHTMLContent = @""
${HTML_CONTENT}
"";
#endif //BPTestReportHTML_h

TEMPLATE
