summaryrefslogtreecommitdiffhomepage
path: root/build.sh
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-02-07 23:48:11 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2020-02-13 10:49:32 +0000
commitae3e7c7abe4825bfe842a1dbe486fcaefda5901c (patch)
treeba2cc9868418a4d4eae8ebb7700e72e73c5e413e /build.sh
parent4ca331577bd4379ae915b37fa0d6f009b29fb9ac (diff)
downloadmullvadvpn-ae3e7c7abe4825bfe842a1dbe486fcaefda5901c.tar.xz
mullvadvpn-ae3e7c7abe4825bfe842a1dbe486fcaefda5901c.zip
Refactor to create `update-relays.sh` script
Diffstat (limited to 'build.sh')
-rwxr-xr-xbuild.sh22
1 files changed, 1 insertions, 21 deletions
diff --git a/build.sh b/build.sh
index 993b39933b..fd7ca56a20 100755
--- a/build.sh
+++ b/build.sh
@@ -190,27 +190,7 @@ if [[ "$BUILD_MODE" == "release" && "$(uname -s)" == "MINGW"* ]]; then
fi
-echo "Updating relay list..."
-set +e
-read -d '' JSONRPC_CODE <<-JSONRPC_CODE
-var buff = "";
-process.stdin.on('data', function (chunk) {
- buff += chunk;
-})
-process.stdin.on('end', function () {
- var obj = JSON.parse(buff);
- var output = JSON.stringify(obj.result, null, ' ');
- process.stdout.write(output);
-})
-JSONRPC_CODE
-set -e
-
-JSONRPC_RESPONSE="$(curl -X POST \
- --fail \
- -H "Content-Type: application/json" \
- -d '{"jsonrpc": "2.0", "id": "0", "method": "relay_list_v3"}' \
- https://api.mullvad.net/rpc/)"
-echo $JSONRPC_RESPONSE | node -e "$JSONRPC_CODE" > dist-assets/relays.json
+./update-relays.sh
pushd "$SCRIPT_DIR/gui"