Skip to content

Commit 50b67be

Browse files
Merge pull request #204 from zrh535/windows-build-fix
prefix / to support building on a windows host
2 parents 490db20 + 3c1ed37 commit 50b67be

File tree

8 files changed

+41
-12
lines changed

8 files changed

+41
-12
lines changed

tools/genappendix.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#!/bin/bash
22

33
DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
4+
## windows hosts require leading // instead of /
5+
case "$OSTYPE" in
6+
msys*) DATA_DIR="/${DATA_DIR}" ;;
7+
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
8+
esac
49
docker run -v ${DATA_DIR}:/data --rm -it trivadis/mktools bash -c "cd /data; ./tools/run-in-container/genappendix.sh docs/9-appendix/appendix.md"

tools/genpdf.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#!/bin/bash
22

33
DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
4+
## windows hosts require leading // instead of /
5+
case "$OSTYPE" in
6+
msys*) DATA_DIR="/${DATA_DIR}" ;;
7+
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
8+
esac
49
docker run -v ${DATA_DIR}:/data --rm -it trivadis/mktools bash -c "cd /data; ./tools/run-in-container/genpdf.sh"

tools/interactive.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
#!/bin/bash
22

33
DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
4-
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash
4+
## windows hosts require leading // instead of /
5+
case "$OSTYPE" in
6+
msys*) DATA_DIR="/${DATA_DIR}" ;;
7+
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
8+
esac
9+
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash

tools/mike.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
#!/bin/bash
22

33
DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
4+
## windows hosts require leading // instead of /
5+
case "$OSTYPE" in
6+
msys*) DATA_DIR="/${DATA_DIR}" ;;
7+
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
8+
esac
49
GIT_USERNAME="$(git config user.name)"
510
GIT_EMAIL="$(git config user.email)"
611
COMMAND="/data/tools/run-in-container/mike.sh '${GIT_USERNAME}' '${GIT_EMAIL}' $1 $2 $3 $4"

tools/run-in-container/genappendix_b_table.awk

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ BEGIN {
2222
text=$0;
2323
# We just remove the # G-<id>: from the beginning of the text
2424
dummy=sub(/^# G-[[:digit:]]+: /,"",text);
25-
25+
2626
# Get the second of the 4 lines and ignore it, it's empty
2727
getline;
28-
28+
2929
# Get the third of the 4 lines
3030
getline;
3131
# Retrieve the severity field from the third line
3232
severity=substr($3,2,length($3)-2);
33-
33+
3434
# Get the fourth and last of the 4 lines
3535
getline;
3636
# If the char array was filled from the last iteration, we need to empty it here
@@ -42,7 +42,7 @@ BEGIN {
4242
char[6]="";
4343
char[7]="";
4444
char[8]="";
45-
45+
4646
# The fourth line is a comma-separated list of characteristics - split them into an array
4747
no_of_characteristics=split($0,characteristics,",");
4848
for (i in characteristics) {
@@ -55,7 +55,7 @@ BEGIN {
5555
if (characteristics[i] ~ /Reusability/ ) {char[6]="&#10008;"}
5656
if (characteristics[i] ~ /Security/ ) {char[7]="&#10008;"}
5757
if (characteristics[i] ~ /Testability/ ) {char[8]="&#10008;"}
58-
58+
5959
# If the characteristics value is something other than these 8 values, we output an error in the text so it'll be noticed
6060
if (!(characteristics[i] ~ /Changeability/ || \
6161
characteristics[i] ~ /Efficiency/ || \
@@ -66,16 +66,15 @@ BEGIN {
6666
characteristics[i] ~ /Security/ || \
6767
characteristics[i] ~ /Testability/ )) {text="!!!CHARACTERISTIC ERROR!!!"}
6868
}
69-
69+
7070
# Output the fields of the markdown table in appendix B
7171
print old_id, new_id, text, severity, char[1], char[2], char[3], char[4], char[5], char[6], char[7], char[8];
72-
72+
7373
# Special handling - between rule G-5040 and G-5050 we output the old rule 54 that is not mapped to any new rule
7474
if (new_id == "5040") {
7575
print "54 | n/a | Avoid use of EXCEPTION_INIT pragma for a 20nnn error. | Major | | | | | &#10008; | | | ";
7676
}
77-
77+
7878
# Done handling the 4 lines of one .md file. Next 4 lines will be from another .md file and be handled in the next iteration.
7979
}
8080
}
81-

tools/run-in-container/genpdf.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function copy_resources() {
1212
cp -r ${DATA_DIR}/docs/stylesheets ${TARGET_DIR}/docs/stylesheets
1313
}
1414

15-
# Materials for MkDocs 5.5.14 uses CSS that leads to wkhtmltopdf 0.12.6 printing all line numbers before the code with
15+
# Materials for MkDocs 5.5.14 uses CSS that leads to wkhtmltopdf 0.12.6 printing all line numbers before the code with
1616
# - "codehilite" plugin and "linenums: true"
1717
# - "pymdownx.highlight" plugin and "linenums_style: table" (default)
1818
# The workaround is to use "pymdownx.highlight" with "linenums_style: pymdownx-inline" and some CSS fixes

tools/serve-ghpages.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22

33
# serves local gh-pages - use to verify deployed sites with version selector before pushing gh-pages branch
44
DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
5+
## windows hosts require leading // instead of /
6+
case "$OSTYPE" in
7+
msys*) DATA_DIR="/${DATA_DIR}" ;;
8+
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
9+
esac
510
docker run -v ${DATA_DIR}:/data -p 8000:8000 --rm -it trivadis/mktools bash -c "cd /data; mike serve -a 0.0.0.0:8000"

tools/serve.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,9 @@
22

33
# serves from temporary site directory - use during development for live preview of changes in docs directory
44
DATA_DIR="$(cd "$(dirname "${0}")/.." && pwd)"
5-
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"
5+
## windows hosts require leading // instead of /
6+
case "$OSTYPE" in
7+
msys*) DATA_DIR="/${DATA_DIR}" ;;
8+
cygwin*) DATA_DIR="/${DATA_DIR}" ;;
9+
esac
10+
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)