2016-06-26 23:22:51 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-03-25 10:35:46 +00:00
|
|
|
cd $(dirname $0)
|
|
|
|
|
2016-06-26 23:22:51 +00:00
|
|
|
draftpng="../draft/boards"
|
|
|
|
dirpng="../resources/boards"
|
2016-07-27 18:25:37 +00:00
|
|
|
draftmd="../draft/overlay"
|
|
|
|
srcdir="../src"
|
2020-06-24 20:59:54 +00:00
|
|
|
|
2016-07-27 19:23:05 +00:00
|
|
|
langlist=$(ls "$srcdir")
|
2016-10-23 13:57:43 +00:00
|
|
|
yamlfile="settings.yaml"
|
2016-06-26 23:22:51 +00:00
|
|
|
|
2017-01-08 17:56:10 +00:00
|
|
|
if [ "$#" -eq 0 ]; then
|
2020-06-24 20:59:54 +00:00
|
|
|
echo "Available files to publish:"
|
|
|
|
for f in $draftmd/*.md; do
|
|
|
|
filename=$(basename -- "$f")
|
|
|
|
extension="${filename##*.}"
|
|
|
|
filename="${filename%.*}"
|
|
|
|
echo "- $filename"
|
|
|
|
done
|
|
|
|
exit 0
|
2017-01-08 17:56:10 +00:00
|
|
|
fi
|
2016-10-22 15:54:49 +00:00
|
|
|
|
2017-01-08 17:56:10 +00:00
|
|
|
board=$1
|
2016-10-22 15:51:01 +00:00
|
|
|
|
2019-06-08 22:45:51 +00:00
|
|
|
if ! [ -f $draftmd/$board.md ]; then
|
|
|
|
echo "Draft file $draftmd/$board.md does not exist!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-01-08 17:56:10 +00:00
|
|
|
for dirmd in ${langlist[@]}; do
|
|
|
|
if [ $dirmd != "en" ]; then
|
|
|
|
if ! [ -f $srcdir/$dirmd/overlay/$board.md ]; then
|
2019-06-08 22:57:02 +00:00
|
|
|
echo "Copying $draftmd/$board.md into $srcdir/$dirmd/translate/"
|
2017-01-08 17:56:10 +00:00
|
|
|
cp $draftmd/$board.md $srcdir/$dirmd/translate/
|
2016-06-26 23:22:51 +00:00
|
|
|
fi
|
2017-01-08 17:56:10 +00:00
|
|
|
else
|
2019-06-08 22:57:02 +00:00
|
|
|
echo "Copying $draftmd/$board.md into $srcdir/$dirmd/overlay/"
|
2017-01-08 17:56:10 +00:00
|
|
|
cp $draftmd/$board.md $srcdir/$dirmd/overlay/
|
|
|
|
fi
|
2016-06-26 23:22:51 +00:00
|
|
|
done
|
|
|
|
|
2017-01-08 17:56:10 +00:00
|
|
|
rm $draftmd/$board.md
|
|
|
|
|
|
|
|
if [ -f $draftpng/$board.png ];then
|
2019-06-08 22:57:02 +00:00
|
|
|
echo "Moving $draftpng/$board.png into $dirpng"
|
2017-01-08 17:56:10 +00:00
|
|
|
mv $draftpng/$board.png $dirpng
|
|
|
|
fi
|
|
|
|
|
2016-06-26 23:22:51 +00:00
|
|
|
exit 0
|