blob: f0493898ad3095b81eaa0b6ee544fa13fea5fa62 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#!/bin/bash
#
# Generates a Go const from the contents of a static file, and appends it at
# the line following the go:generate directive that calls this script.
#
set -euo pipefail
sed -i.sed.bak -e "$((GOLINE+1)),\$d" "$GOFILE"
rm "$GOFILE.sed.bak"
(echo -n "const $1 = \`"; cat "$2"; echo "\`") >> "$GOFILE"
|