From 65f94456ad75ae15c57105243fee21b1bf7e7459 Mon Sep 17 00:00:00 2001 From: streetturtle Date: Sun, 15 Dec 2019 15:49:05 -0500 Subject: [PATCH] add script to update widgets readme and screenshots --- update_from_master.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 update_from_master.sh diff --git a/update_from_master.sh b/update_from_master.sh new file mode 100644 index 0000000..b66759b --- /dev/null +++ b/update_from_master.sh @@ -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