add script to update widgets readme and screenshots

This commit is contained in:
streetturtle 2019-12-15 15:49:05 -05:00
parent 4b38edf4ad
commit 65f94456ad
1 changed files with 18 additions and 0 deletions

18
update_from_master.sh Normal file
View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
master_dir="$HOME/.config/awesome/awesome-wm-widgets/"
pages_dir="$HOME/home-dev/awesome-wm-widgets/"
cd ${master_dir}
for D in *; do
if [[ -d "${D}" ]] && [[ ${D} == *"-widget"* ]]; then
echo "${D}"
cp ${D}/README.md ${pages_dir}/_widgets/${D}.md
sed -i '1s/^/---\nlayout: page\n---\n/' ${pages_dir}/_widgets/${D}.md
mkdir -p ${pages_dir}/assets/img/screenshots/${D}
cp ${D}/*.{png,gif,jpg,svg} ${pages_dir}/assets/img/screenshots/${D}
sed -i "s/](./](..\/awesome-wm-widgets\/assets\/img\/screenshots\/$D/g" ${pages_dir}/_widgets/${D}.md
fi
done