#!/bin/bash

read -p "Enter your SVN username: " username
read -s -p "Enter your SVN password: " userpassword
echo  # 개행

# SVN 저장소 URL
svn_repo_url="svn://10.0.10.183/shopbyscript"

# 대상 파일 및 디렉토리 목록
file_path="./svn_txt/export_list.txt"

# 파일 존재 여부 확인
if [ -e "$file_path" ]; then
        # 파일 내용을 배열로 읽어오기
        IFS=$'\n' read -d '' -r -a file_content < "$file_path"

        # 배열 내용 출력
        # SVN export 명령어 실행
        for item in "${file_content[@]}"; do
                svn export --force --username "$username" --password "$userpassword" --non-interactive "${svn_repo_url}/${item}" "${item}"
        done
        echo "Export completed successfully."
else
        echo "파일이 존재하지 않습니다: $file_path"
fi

