-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.sh
32 lines (25 loc) · 1.73 KB
/
test.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
CHANGED_FILE=./test2
NUM=23370202
#NUM=
echo $CHANGED_FILE
#URI_LIST=`ag "https://((user-images\.githubusercontent.*?\/$NUM\/)|(pbs.twimg.com/media/)|(video.twimg.com/.+_video/)).*?(png|jpg|gif|mp4)" -o $CHANGED_FILE`
#https://user-images.githubusercontent.com/23370202/233828006-f7031b60-4c08-45f6-98a0-efc5d993b123.png
#URI_LIST=`ag "https://((user-images\.githubuser.*?\/[0-9]+\/)).*?(png|jpg|gif|mp4)" -o $CHANGED_FILE`
#https://github.com/CodingMateMoon/CodingMateMoon.github.io/assets/23370202/8f0523c0-4b07-46a0-a17f-c246271ffc8e
#https://github-production-user-asset-6210df.s3.amazonaws.com/23370202/240833817-8f0523c0-4b07-46a0-a17f-c246271ffc8e.png
URI_LIST=`ag "https://github-production.*?\/$NUM\/.*?(png|jpg|gif|mp4)" -o $CHANGED_FILE`
echo "URI_LIST : $URI_LIST"
SUCCESS_COUNT=0
FAIL_COUNT=0
echo "이미지경로를 교정할 문서 파일: [$CHANGED_FILE]"
RESOURCE_DIR=`head $CHANGED_FILE | egrep -o '[A-F0-9-]{2}/[A-F0-9-]{34}$'`
echo "RESOURCE_DIR : $RESOURCE_DIR"
TARGET_PATH="./resource/$RESOURCE_DIR"
echo "생성할 디렉토리 경로: [$TARGET_PATH]"
mkdir -p $TARGET_PATH
# 작업 대상 파일에서 참조하고 있는 github에 등록된 리소스 파일들의 URI 목록
# URI_LIST=`ag "https://user-images\.githubuser.*?\/$NUM\/.*?(png|jpg|gif|mp4)" -o $CHANGED_FILE`
# URI_LIST=`ag "https://pbs.twimg.com/media/.*?(png|jpg|gif|mp4)" -o $CHANGED_FILE`
#URI_LIST=`ag "https://((user-images\.githubuser.*?\/[0-9]+\/)|(pbs.twimg.com/media/)|(video.twimg.com/.+_video/)).*?(png|jpg|gif|mp4)" -o $CHANGED_FILE`
URI_LIST=`ag "https://((user-images\.githubuser.*?\/[0-9]+\/)|(pbs.twimg.com/media/)|(video.twimg.com/.+_video/)).*?(png|jpg|gif|mp4)" -o $CHANGED_FILE`
echo "URI_LIST : $URI_LIST"