-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathget_targets.sh
More file actions
executable file
·46 lines (43 loc) · 896 Bytes
/
get_targets.sh
File metadata and controls
executable file
·46 lines (43 loc) · 896 Bytes
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
#
if [ -z "$1" ]
then
echo "Usage: $0 <TARGET_FOLDER> <FROM_REVISION>"
exit 1
fi
REVISION="$2"
if [ -z "$2" ]
then
REVISION="HEAD^"
fi
shopt -s extglob
DEVS_EN_DIFF="$(git diff $REVISION HEAD --name-only _pages/devs_en)"
DEVS_RU_DIFF="$(git diff $REVISION HEAD --name-only _pages/devs_ru)"
KB_EN_DIFF="$(git diff $REVISION HEAD --name-only _pages/kb_en)"
KB_RU_DIFF="$(git diff $REVISION HEAD --name-only _pages/kb_ru)"
MAIN_DIFF="$(git diff $REVISION HEAD --name-only !(_pages|attachments))"
if [ ! -z "$MAIN_DIFF" ]
then
touch "$1/devs_en"
touch "$1/devs_ru"
touch "$1/kb_en"
touch "$1/kb_ru"
exit
fi
if [ ! -z "$DEVS_EN_DIFF" ]
then
touch "$1/devs_en"
fi
if [ ! -z "$DEVS_RU_DIFF" ]
then
touch "$1/devs_ru"
fi
if [ ! -z "$KB_EN_DIFF" ]
then
touch "$1/kb_en"
fi
if [ ! -z "$KB_RU_DIFF" ]
then
touch "$1/kb_ru"
fi
exit