-
-
Notifications
You must be signed in to change notification settings - Fork 67
/
generate.sh
executable file
·78 lines (67 loc) · 2.39 KB
/
generate.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#!/bin/bash
set -x
ROOT_DIR=$(pwd)
DOCS_DIR=$ROOT_DIR/src
cd $DOCS_DIR
# Setup java-design-patterns - English
rm -rf java-design-patterns
rm -rf patterns
rm -rf zh/patterns
git clone https://github.com/iluwatar/java-design-patterns.git
cd java-design-patterns
git checkout-index -a -f --prefix=../patterns/
cd ../patterns
rm -rf etc .circleci .editorconfig .github .mvn checkstyle-suppressions.xml CONTRIBUTING.MD LICENSE.md license-plugin-header-style.xml mvnw mvnw.cmd pom.xml PULL_REQUEST_TEMPLATE.md .all-contributorsrc .gitignore gpl-3.0.txt layers.log lgpl-3.0.txt lombok.config service-layer.log
find . -maxdepth 2 -type d -exec bash -c 'cd "{}" && pwd && rm -rf src pom.xml *.ucls *.puml .gitignore' \;
rm -vf README.md
$ROOT_DIR/index.sh "en" "Design Pattern Catalog" "Catalog of Java Design Patterns for Developers" "Discover the full list of Java design patterns. This comprehensive guide provides you with all the information you need to master pattern implementation in your Java applications."
# Setup java-design-patterns - localizations
languages=( zh ko es )
catalogs=( "设计模式目录" "디자인 패턴 카탈로그" "Catalogo de patrones de diseño" )
iter=0
for lan in "${languages[@]}"
do
cd localization/$lan
mkdir -p ../../../$lan/patterns
cp -vrf * ../../../$lan/patterns
cd ../../../$lan/patterns
rm -vf README.md
$ROOT_DIR/index.sh "$lan" "${catalogs[$iter]}"
cd ../../patterns
iter=$((iter+1))
done
cd $DOCS_DIR
rm -rf java-design-patterns
rm -rf patterns/localization
# setup programming-principles - English
rm -rf programming-principles
rm -rf principles
rm -rf zh/principles
git clone https://github.com/iluwatar/programming-principles.git
cd programming-principles
git checkout-index -f --prefix=../principles/ README.md
# setup programming-principles - localizations
languages=( zh ko es )
for lan in "${languages[@]}"
do
mkdir ../$lan/principles
cp -vf README.md ../$lan/principles/
done
cd ..
rm -rf programming-principles
# setup 30-seconds-of-java - English
rm -rf 30-seconds-of-java
rm -rf snippets
rm -rf zh/snippets
git clone https://github.com/iluwatar/30-seconds-of-java.git
cd 30-seconds-of-java
git checkout-index -f --prefix=../snippets/ README.md
# setup 30-seconds-of-java - localizations
languages=( zh ko es )
for lan in "${languages[@]}"
do
mkdir ../$lan/snippets
cp -vf localization/$lan/README.md ../$lan/snippets/
done
cd ..
rm -rf 30-seconds-of-java