File tree Expand file tree Collapse file tree 3 files changed +24
-58
lines changed
Expand file tree Collapse file tree 3 files changed +24
-58
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # for easy testing, we can make this script separate
4+ TEMP_DIR_GIT=$1
5+ EXCHANGE_NAME=$2
6+
7+ echo " Generating exchange repository for $EXCHANGE_NAME in $TEMP_DIR_GIT "
8+
9+ # just for caution (to avoid accidental mistake) TEMP_DIR_GIT should contain either `tmp` or `temp` in its name
10+ if [[ $TEMP_DIR_GIT != * " tmp" * ]] && [[ $TEMP_DIR_GIT != * " temp" * ]]; then
11+ echo " Error: TEMP_DIR_GIT should contain either 'tmp' or 'temp' in its name"
12+ exit 1
13+ fi
14+
15+ rm -rf $TEMP_DIR_GIT /*
16+ rsync -av --info=progress2 --info=name0 --exclude=' .git/' --exclude=' build/ccxt/' ./ $TEMP_DIR_GIT
17+ rm -f $TEMP_DIR_GIT /.github/workflows/transfer-all.yml
18+ rm -f $TEMP_DIR_GIT /.github/workflows/transfer-exchange.yml
19+ rm -r $TEMP_DIR_GIT /.vscode/
20+ rm -f $TEMP_DIR_GIT /vsc-workspace.code-workspace
21+ rm -f $TEMP_DIR_GIT /README.md
22+ echo $EXCHANGE_NAME > $TEMP_DIR_GIT /exchange_name
Original file line number Diff line number Diff line change @@ -11,17 +11,10 @@ echo "Cloning $EXCHANGE_NAME-python repository into $TEMP_DIR_GIT"
1111git clone https://x-access-token:$GITHUB_API_TOKEN @github.com/ccxt/$EXCHANGE_NAME -python.git $TEMP_DIR_GIT
1212# at first, clean th directory (except .git directory) and copy all files
1313echo " Clone finished"
14- rm -rf $TEMP_DIR_GIT /*
15- rm -rf $TEMP_DIR_GIT /.github/*
16- rsync -av --info=progress2 --info=name0 --exclude=' .git/' --exclude=' tmp/' --exclude=' build/ccxt/' ./ $TEMP_DIR_GIT
17- rm -f $TEMP_DIR_GIT /.github/workflows/transfer-all.yml
18- rm -f $TEMP_DIR_GIT /.github/workflows/transfer-exchange.yml
19- rm -r $TEMP_DIR_GIT /.vscode/
20- rm -f $TEMP_DIR_GIT /vsc-workspace.code-workspace
14+ chmod +x .github/scripts/generate-exchange.sh
15+ .github/scripts/generate-exchange.sh $TEMP_DIR_GIT $EXCHANGE_NAME
2116cd $TEMP_DIR_GIT
22- echo $EXCHANGE_NAME > exchange_name
2317git config user.name github-actions
2418git config user.email
[email protected] 2519git add .
26- rm -f README.md
2720(git commit -m " $COMMIT_MSG " && git push origin main --force) || echo " No changes to commit"
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments