Files
Popura/make_assets
T
2020-08-11 15:01:25 -04:00

19 lines
403 B
Bash
Executable File

#!/bin/sh
set -ef
PEER_LIST=${PEER_LIST:-"assets/peers.txt"}
# Create peers.go "asset" file
make_peers_go() {
PEERS_GO_FILE="src/autopeering/peers.go"
printf "package autopeering\nvar PublicPeers = []string{\n" >$PEERS_GO_FILE
while IFS= read -r line
do
printf "\t\"$line\",\n" >> $PEERS_GO_FILE
done < $PEER_LIST
sed -i -e "$ s/,/}/" $PEERS_GO_FILE
}
make_peers_go