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.
|
2020-05-15 04:34:54 +00:00
|
|
|
|
|
|
|
BASE_DIR=$(dirname $(readlink -f $0))
|
2019-05-10 06:10:29 +00:00
|
|
|
|
|
|
|
function do_make_links()
|
|
|
|
{
|
2020-05-15 04:34:54 +00:00
|
|
|
set -x
|
2021-03-31 23:35:41 +00:00
|
|
|
langs=(en zh ru ja)
|
2019-05-10 06:10:29 +00:00
|
|
|
src_file="$1"
|
|
|
|
for lang in "${langs[@]}"
|
|
|
|
do
|
2020-05-15 04:34:54 +00:00
|
|
|
dst_file="${src_file/\/en\///${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
|
2020-05-15 04:34:54 +00:00
|
|
|
find "${BASE_DIR}/../en" -iname '*.md' -exec /bin/bash -c 'do_make_links "{}"' \;
|