Skip to content

Commit 8b9fcbf

Browse files
moved shell scripts to subdirectory tools
1 parent b5a6580 commit 8b9fcbf

File tree

7 files changed

+21
-17
lines changed

7 files changed

+21
-17
lines changed

genpdf.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

gh-deploy.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

serve.sh

Lines changed: 0 additions & 3 deletions
This file was deleted.

genpdf-in-container.sh renamed to tools/genpdf-in-container.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ function create_target_dir(){
66
}
77

88
function copy_resources() {
9-
cp ./mkdocs.yml ${TARGET_DIR}/mkdocs.yml
10-
cp -r docs/images ${TARGET_DIR}/docs
11-
cp -r docs/stylesheets ${TARGET_DIR}/docs/stylesheets
9+
cp ${DATA_DIR}/mkdocs.yml ${TARGET_DIR}/mkdocs.yml
10+
cp -r ${DATA_DIR}/docs/images ${TARGET_DIR}/docs
11+
cp -r ${DATA_DIR}/docs/stylesheets ${TARGET_DIR}/docs/stylesheets
1212
}
1313

1414
function write_file(){
1515
FILE=$1
1616
echo "" >> ${TARGET_DIR}/docs/index.md
17-
sed -e 's/..\/image/image/g' docs/${FILE} | sed -e 's/✘/X/g' >> ${TARGET_DIR}/docs/index.md
17+
sed -e 's/..\/image/image/g' ${DATA_DIR}/docs/${FILE} | sed -e 's/✘/X/g' >> ${TARGET_DIR}/docs/index.md
1818
}
1919

2020
function write_text(){
@@ -26,7 +26,7 @@ function write_text(){
2626
function write_guidelines(){
2727
DIR=$1
2828
FIRST_HEADER=$2
29-
for f in docs/${DIR}/g-*.md
29+
for f in ${DATA_DIR}/docs/${DIR}/g-*.md
3030
do
3131
echo "" >> ${TARGET_DIR}/docs/index.md
3232
sed -e "s|# |${FIRST_HEADER} |g" $f >> ${TARGET_DIR}/docs/index.md
@@ -37,10 +37,11 @@ function convert_to_pdf(){
3737
cd ${TARGET_DIR}
3838
mkdocs build
3939
cd site
40-
weasyprint index.html ../../plsql.pdf
40+
weasyprint index.html ${DATA_DIR}/plsql.pdf
4141
}
4242

43-
TARGET_DIR=work-pdf
43+
DATA_DIR="$(cd "$(dirname "${0}")" && pwd)"
44+
TARGET_DIR=${DATA_DIR}/work-pdf
4445

4546
create_target_dir
4647
copy_resources
@@ -69,4 +70,4 @@ write_file "5-complexity-analysis/complexity-analysis.md"
6970
write_file "6-code-reviews/code-reviews.md"
7071
write_file "7-tool-support/tool-support.md"
7172
write_file "9-appendix/appendix.md"
72-
convert_to_pdf
73+
#convert_to_pdf

tools/genpdf.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#/bin/bash
2+
3+
DATA_DIR="$(cd "$(dirname "${0}")" && pwd)"
4+
docker run -v ${DATA_DIR}:/data --rm -it trivadis/mktools bash -c "cd /data; ./genpdf-in-container.sh"

tools/gh-deploy.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#/bin/bash
2+
3+
DATA_DIR="$(cd "$(dirname "${0}")" && pwd)"
4+
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash -c "cd /data; mkdocs gh-deploy"

tools/serve.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#/bin/bash
2+
3+
DATA_DIR="$(cd "$(dirname "${0}")" && pwd)"
4+
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash -c "cd /data; mkdocs serve -a 0.0.0.0:8000"

0 commit comments

Comments
 (0)