File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
# set K8S_WEBSITE in your env to your docs website root
4
+ # or rely on this script to determine it automatically
5
+ # You must run the script inside the repository for that to work
6
+ #
4
7
# Note: website/content/<lang>/docs
5
- CONTENT_DIR=${K8S_WEBSITE} /content
8
+
9
+ find_content_dir () {
10
+ local self
11
+ local top
12
+ if command git rev-parse --is-inside-work-tree > /dev/null 2>&1 ; then
13
+ self=" $0 "
14
+ top=" $( command git rev-parse --show-toplevel) "
15
+ while ( cd " ${top} /.." && command git rev-parse --is-inside-work-tree> /dev/null 2>&1 ); do
16
+ top=" $( cd " ${top} /.." && " ${self} " ) "
17
+ done
18
+ printf " %s/content" " ${top} "
19
+ else
20
+ printf " Could not autodetect CONTENT_DIR\n" 1>&2
21
+ exit 1
22
+ fi
23
+ }
24
+
25
+ if [ -z ${K8S_WEBSITE+x} ]; then
26
+ CONTENT_DIR=" $( find_content_dir ) "
27
+ else
28
+ CONTENT_DIR=${K8S_WEBSITE} /content
29
+ fi
30
+
31
+ if ! [ -d " ${CONTENT_DIR} " ]; then
32
+ printf " Directory %s not found\n" " ${CONTENT_DIR} " 1>&2
33
+ exit 1
34
+ fi
6
35
7
36
# 16 langs
8
37
# de en es fr hi id it ja ko no pl pt ru uk vi zh
You can’t perform that action at this time.
0 commit comments