-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.py
executable file
·41 lines (30 loc) · 965 Bytes
/
build.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#! /bin/python3
import sys
import json
def handle_coop_disabled():
print("Cooperative signatures are disabled in config")
with open("./src/config.ts", "r") as f:
for line in f:
if "cooperativeDisabled" not in line:
continue
if "false" not in line:
handle_coop_disabled()
network: str | None = None
with open("./public/config.json") as f:
data = json.load(f)
network = data["network"]
if data.get("cooperativeDisabled", False):
handle_coop_disabled()
# .env file is not required on regtest
if network != "regtest":
try:
with open(".env", "r") as f:
data = f.read()
for var in [
"VITE_RSK_LOG_SCAN_ENDPOINT",
"VITE_CHATWOOT_TOKEN"
]:
if var not in data:
print(f"WARN: {var} not in .env file")
except Exception as e:
print("WARN: could not open .env file:", e)