Skip to content

Commit

Permalink
feat(sync_mirror): automatically rename community templates with ambi…
Browse files Browse the repository at this point in the history
…gious names after mirror sync
  • Loading branch information
actionless committed Jul 15, 2024
1 parent f6737dd commit 1248c04
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sync_mirror.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SCHEMES_RESULT_DIR="${SCRIPT_DIR}"/schemes

TEMPLATES_INDEX="${SCRIPT_DIR}"/templates.yaml
TEMPLATES_EXTRA_INDEX="${SCRIPT_DIR}"/templates_extra.yaml
TEMPLATES_RENAME="${SCRIPT_DIR}"/templates_rename.txt
TEMPLATES_EXTRA_DIR="${SCRIPT_DIR}"/templates_extra
TEMPLATES_WORKDIR="${SCRIPT_DIR}"/templates.tmp
TEMPLATES_RESULT_DIR="${SCRIPT_DIR}"/templates
Expand Down Expand Up @@ -63,6 +64,12 @@ if [[ ${1:-} != '--extra-only' ]] ; then
parallel-moreutils "${GET_ASSET}" "${TEMPLATES_WORKDIR}" -- $(grep -hv '^#' "${TEMPLATES_INDEX}" "${TEMPLATES_EXTRA_INDEX}")
fi

while read -r line ; do
rename_from=$(cut -d: -f1 <<< "$line")
rename_to=$(cut -d: -f2 <<< "$line")
mv "${TEMPLATES_WORKDIR}/${rename_from}" "${TEMPLATES_WORKDIR}/${rename_to}"
done < <(sed -e 's/ -> /:/g' < "$TEMPLATES_RENAME")

rsync -rv \
--delete \
--exclude=".git" \
Expand Down
3 changes: 3 additions & 0 deletions templates_rename.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
doom -> emacs-doom
gtk-flatcolor -> gtk2-flatcolor
styles -> css-styles

0 comments on commit 1248c04

Please sign in to comment.