From be3b2ce4e0edd1d246db6e6fa376a6ed9c310008 Mon Sep 17 00:00:00 2001 From: LiLittleCat Date: Wed, 31 May 2023 14:14:58 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20temp.sh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- temp.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 temp.sh diff --git a/temp.sh b/temp.sh new file mode 100755 index 0000000..0c5090a --- /dev/null +++ b/temp.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# 1. checkout develop branch +git checkout develop + +# 2. create target directory if it does not exist +if [ ! -d "../awesome-free-chatgpt-temp" ]; then + mkdir ../awesome-free-chatgpt-temp +fi +# 3. copy files to target directory +cp README.md README_en.md urls.json ../awesome-free-chatgpt-temp/ + +# 4. create a new branch from main branch +if [ -n "$1" ]; then + branch_name=$1 +else + branch_name=$(date +%Y%m%d) +fi + +git checkout main +git pull +git checkout -b $branch_name + +# 5. copy files from target directory to current directory +cp ../awesome-free-chatgpt-temp/* .