2019-05-10 06:10:29 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Fixes missing documentation in other languages
|
|
|
|
# by putting relative symbolic links to the original doc file.
|
|
|
|
# This is to be run from root of language directory, like "docs/en".
|
|
|
|
|
|
|
|
function do_make_links()
|
|
|
|
{
|
2020-03-30 08:25:29 +00:00
|
|
|
langs=(en es zh fr ru ja fa)
|
2019-05-10 06:10:29 +00:00
|
|
|
src_file="$1"
|
|
|
|
for lang in "${langs[@]}"
|
|
|
|
do
|
|
|
|
# replacing "/./" with /
|
2019-12-05 16:36:51 +00:00
|
|
|
dst_file="../${lang}${src_file}"
|
2019-05-10 06:10:29 +00:00
|
|
|
dst_file="${dst_file/\/\.\//\/}"
|
2020-02-14 16:48:08 +00:00
|
|
|
dst_file="${dst_file/${lang}\./${lang}}"
|
2019-05-10 06:10:29 +00:00
|
|
|
|
|
|
|
mkdir -p $(dirname "${dst_file}")
|
2020-02-14 16:48:08 +00:00
|
|
|
ln -sr "${src_file}" "${dst_file}" 2>/dev/null
|
2019-05-10 06:10:29 +00:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
export -f do_make_links
|
|
|
|
find . -iname '*.md' -exec /bin/bash -c 'do_make_links "{}"' \;
|