From e95ba5b75fa7cba696a6862acdbab88f9b480532 Mon Sep 17 00:00:00 2001 From: Fernando Collova Date: Tue, 26 Mar 2019 19:12:53 -0300 Subject: [PATCH 1/4] Add plugin sorting before execution --- git-semver.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/git-semver.sh b/git-semver.sh index 51cbfc6..848a653 100755 --- a/git-semver.sh +++ b/git-semver.sh @@ -63,7 +63,10 @@ plugin-list() { plugin_dir="${dirs[${i}]}/.git-semver/plugins" if [ -d "${plugin_dir}" ] then - find "${plugin_dir}" -maxdepth 1 -type f -exec echo "${plugin_type},{}" \; + for plugin in $(find "${plugin_dir}" -maxdepth 1 -type f | sort -k 1.1n,1.2n) + do + echo "${plugin_type},${plugin}" + done fi done } From be7cff876cd9bfda198434b1fc43064ac2433b9c Mon Sep 17 00:00:00 2001 From: Fernando Collova Date: Tue, 9 Apr 2019 11:50:30 -0300 Subject: [PATCH 2/4] Fixed sorting of plugins --- git-semver.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/git-semver.sh b/git-semver.sh index 848a653..a76311c 100755 --- a/git-semver.sh +++ b/git-semver.sh @@ -63,9 +63,9 @@ plugin-list() { plugin_dir="${dirs[${i}]}/.git-semver/plugins" if [ -d "${plugin_dir}" ] then - for plugin in $(find "${plugin_dir}" -maxdepth 1 -type f | sort -k 1.1n,1.2n) + for plugin in $(find "${plugin_dir}" -maxdepth 1 -type f -exec basename {} \; | sort -V) do - echo "${plugin_type},${plugin}" + echo "${plugin_type},${plugin_dir}/${plugin}" done fi done From e84c08c97229320a53f4d5502f8831936a41fa3c Mon Sep 17 00:00:00 2001 From: Fernando Collova Date: Wed, 10 Apr 2019 15:04:26 -0300 Subject: [PATCH 3/4] Fixed MacOS compatibility --- git-semver.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/git-semver.sh b/git-semver.sh index a76311c..8d85209 100755 --- a/git-semver.sh +++ b/git-semver.sh @@ -63,7 +63,12 @@ plugin-list() { plugin_dir="${dirs[${i}]}/.git-semver/plugins" if [ -d "${plugin_dir}" ] then - for plugin in $(find "${plugin_dir}" -maxdepth 1 -type f -exec basename {} \; | sort -V) + plugins=() + for plugin in $(find "${plugin_dir}" -maxdepth 1 -type f -exec basename {} \; | grep "^[0-9]" | LC_ALL="C" sort -g) + do + echo "${plugin_type},${plugin_dir}/${plugin}" + done + for plugin in $(find "${plugin_dir}" -maxdepth 1 -type f -exec basename {} \; | grep "^[^0-9]" | LC_ALL="C" sort -g) do echo "${plugin_type},${plugin_dir}/${plugin}" done From 24b796762f638efe6cb7b687c94af6b64099a7e7 Mon Sep 17 00:00:00 2001 From: Fernando Collova Date: Wed, 10 Apr 2019 15:08:17 -0300 Subject: [PATCH 4/4] Added documentation --- PLUGINS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PLUGINS.md b/PLUGINS.md index afb870c..6c208a7 100644 --- a/PLUGINS.md +++ b/PLUGINS.md @@ -19,7 +19,7 @@ Location | Contains `./.git-semver/plugins` | Project plugins (added and committed) which run on just the current git project `${HOME}/.git-semver/plugins/` | User plugins which run on all git projects -Plugin can stop a tag being generated (for example if a version file does not exist). +Plugins are executed orderedly, so you can number-prefix them to ensure execution order. Number prefixed plugins will run before anything else, and they will be executed from lower to higher. Plugins can also stop a tag being generated (for example if a version file does not exist). See [Contributing](#contributing) for detail on creating a plugin or take a look at the [example plugin] or any of the [real plugins](#plugins).