summaryrefslogtreecommitdiff
path: root/Meta/text-to-cpp-string.sh
blob: 9be37c404274cfbae55be6d6758e70306d9cf811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/env bash
# $1 name of the variable
# $2 input path

echo "#include <AK/StringView.h>"
echo
echo "extern StringView $1;"
printf "StringView %s = R\"~~~(" "$1"
grep -v '^ *#' < "$2" | while IFS= read -r line; do
  echo "$line"
done
echo ")~~~\"sv;"