From 5ec60ebd71c0748feb899ac8b8a460417377ac82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A2=8E=E5=BF=B5=5FNian?= Date: Fri, 2 Feb 2024 21:26:07 +0800 Subject: [PATCH] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4403646..0754c94 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,7 +36,7 @@ jobs: - name: Backup local .txt files run: | mkdir backup - if [ -e *.txt ]; then + if ls *.txt &> /dev/null; then cp *.txt backup/ else echo "No .txt files to backup" @@ -51,7 +51,7 @@ jobs: # Restore local .txt files and delete backup - name: Restore local .txt files and delete backup run: | - if [ -e backup/*.txt ]; then + if ls backup/*.txt &> /dev/null; then cp backup/*.txt . rm -rf backup else