commit 5991150961a7d50a140b828fc3f49c6c479a14e7
parent 2a471e989f7cbc91b62b9331bd4ff11b26bd3246
Author: oscarbenedito <oscar@obenedito.org>
Date:   Mon, 18 Nov 2019 00:19:23 +0100

Performance improvements on script calling to Markion

Diffstat:
M.chezmoiignore | 1+
Mdot_bash_aliases.tmpl.md | 2+-
Amarkion.sh | 10++++++++++
Drun_markion.sh | 9---------
4 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/.chezmoiignore b/.chezmoiignore @@ -1,5 +1,6 @@ COPYING CC0-1.0 +markion.sh markion.py *.md .scripts/*.md diff --git a/dot_bash_aliases.tmpl.md b/dot_bash_aliases.tmpl.md @@ -2,7 +2,7 @@ Alias to run Markion everytime we use chezmoi, before actually running chezmoi. ``` file dot_bash_aliases.tmpl chezmoi() { - sh $HOME/.local/share/chezmoi/run_markion.sh + sh $HOME/.local/share/chezmoi/markion.sh /bin/chezmoi $* } ``` diff --git a/markion.sh b/markion.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Licensed under CC0 1.0 Universal. To the extent possible under law, Oscar +# Benedito, who associated CC0 with this work has waived all copyright and +# related or neighboring rights to this work. +for f in $(find $HOME/.local/share/chezmoi -name "*.md"); do + if [ "$f" = "$HOME/.local/share/chezmoi/README.md" -o "${f%.*}" -nt "$f" ]; then + continue + fi + python3.6 $HOME/.local/share/chezmoi/markion.py -D $f +done diff --git a/run_markion.sh b/run_markion.sh @@ -1,9 +0,0 @@ -#!/bin/bash -# Licensed under CC0 1.0 Universal. To the extent possible under law, Oscar -# Benedito, who associated CC0 with this work has waived all copyright and -# related or neighboring rights to this work. -for f in $(find $HOME/.local/share/chezmoi -name "*.md"); do - if [ "$f" != "$HOME/.local/share/chezmoi/README.md" ]; then - python3.6 $HOME/.local/share/chezmoi/markion.py -D $f - fi -done