-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·34 lines (22 loc) · 1.1 KB
/
setup.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
#!/bin/bash
SUBMODULE_PATH="./xeon-private-modules"
declare -a SHIM_PACKAGES=("ft-buybot" "new-liquidity-pools" "nft-buybot" "potlock" "price-alerts" "socialdb" "new-tokens" "image-gen" "trading-bot")
if [ -f "$SUBMODULE_PATH/.git" ] || [ -d "$SUBMODULE_PATH/.git" ]; then
echo "Submodule $SUBMODULE_PATH already exists."
exit 0
fi
git submodule update --init --recursive $SUBMODULE_PATH
if [ -f "$SUBMODULE_PATH/.git" ]; then
echo "Private modules successfully downloaded."
else
echo "Failed to download private submodule. Using only open-source modules..."
mkdir -p $SUBMODULE_PATH
cd $SUBMODULE_PATH || exit
for package in "${SHIM_PACKAGES[@]}"; do
cargo new --lib "$package"
done
git init
cd ..
git checkout Cargo.toml
echo "Shim crates installed in $SUBMODULE_PATH, the project is ready to be built using 'cargo build'. You may have seen some warnings like 'failed to load manifest for workspace member $PWD/tearbot', 'failed to load manifest for dependency', 'failed to read $PWD/xeon-private-modules/something/Cargo.toml', you can safely ignore them."
fi