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()
|
|
|
|
{
|
2019-12-02 09:21:34 +00:00
|
|
|
langs=(en ru zh 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/\/\.\//\/}"
|
|
|
|
|
|
|
|
mkdir -p $(dirname "${dst_file}")
|
|
|
|
ln -sr "${src_file}" "${dst_file}"
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
export -f do_make_links
|
|
|
|
find . -iname '*.md' -exec /bin/bash -c 'do_make_links "{}"' \;
|