Skip to content

Commit 1ad9f08

Browse files
author
github-actions
committed
[TRANSFER]
1 parent 5488eac commit 1ad9f08

File tree

3 files changed

+24
-58
lines changed

3 files changed

+24
-58
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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

.github/scripts/push-to-repo.sh

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,10 @@ echo "Cloning $EXCHANGE_NAME-python repository into $TEMP_DIR_GIT"
1111
git 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
1313
echo "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
2116
cd $TEMP_DIR_GIT
22-
echo $EXCHANGE_NAME > exchange_name
2317
git config user.name github-actions
2418
git config user.email [email protected]
2519
git add .
26-
rm -f README.md
2720
(git commit -m "$COMMIT_MSG" && git push origin main --force) || echo "No changes to commit"

README.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)