forked from skalenetwork/portal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
43 lines (31 loc) · 1.07 KB
/
build.sh
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
42
43
#!/usr/bin/env bash
set -e
: "${NETWORK_NAME?Need to set NETWORK_NAME}"
export DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
METAPORT_CONFIG_PATH=$DIR/config/$NETWORK_NAME.ts
METAPORT_CONFIG_PATH_SRC=$DIR/src/data/metaportConfig.ts
echo "Copying ${METAPORT_CONFIG_PATH} -> ${METAPORT_CONFIG_PATH_SRC}..."
cp $METAPORT_CONFIG_PATH $METAPORT_CONFIG_PATH_SRC
META_DIR_EXTERNAL=$DIR/skale-network/metadata/$NETWORK_NAME/
META_DIR=$DIR/src/meta/
if [ -d "$META_DIR" ]; then
echo "Removing ${META_DIR}..."
rm -rf $META_DIR
else
echo "${META_DIR} not found, skipping"
fi
if [ -d "$META_DIR_EXTERNAL" ]; then
echo "Copying ${META_DIR_EXTERNAL} -> ${META_DIR}..."
cp -R $META_DIR_EXTERNAL $META_DIR
else
cp -R $DIR/skale-network/metadata/mainnet/ $META_DIR
echo "${META_DIR_EXTERNAL} not found, copying Mainnet meta"
fi
node generate-imports.cjs ./src/meta/logos
node generate-imports.cjs ./src/assets/validators
bash generate_sitemap.sh
echo "Building packages..."
bun run build:packages
bun i
echo "Building..."
bun run build:portal