Date: 2024/02/28 09:27:15 UTC-08:00
Type: Batch File (DOS)
@echo off
SETLOCAL
set "FOLDER_NAME=test-pack"
set "ZIP_FILE=test-pack.zip"
cd %FOLDER_NAME%
REM Check if .git directory exists
if not exist ".git" (
echo This script requires a git repository.
goto End
)
REM Pull the latest changes from the remote repository
echo Pulling latest changes from the git repository...
git pull
REM Check for git pull errors
if errorlevel 1 (
echo Error encountered during 'git pull'. Aborting script.
goto End
)
REM Using git to archive non-ignored files
echo Creating archive of non-ignored files...
git archive -o "../%ZIP_FILE%" HEAD
echo Archive created successfully.
:End
ENDLOCAL