From 7bf44712988de8b8dfc04646f6d214e92a6c23ea Mon Sep 17 00:00:00 2001 From: Fernando Faria <1319357+ffariajr@users.noreply.github.com> Date: Tue, 29 Aug 2023 12:03:26 -0400 Subject: [PATCH 1/4] Create script-hooks.md --- configuration/script-hooks.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 configuration/script-hooks.md diff --git a/configuration/script-hooks.md b/configuration/script-hooks.md new file mode 100644 index 0000000..6e700a4 --- /dev/null +++ b/configuration/script-hooks.md @@ -0,0 +1,28 @@ +# Script Hooks + +You can create scripts that run before, after, or after in case of error for any command. + +## Hook Scripts Location + +Relative to your installation directory, create a folder: + +``` +lgsm/hooks +``` + +## Script Naming + +Script hooks are named according to this convention: + +``` +hook--.sh +``` + +`` can have the values `pre`, `post`, or `error`. Post and error hooks are mutually exclusive and never run within the same command. + +`` must match long command names. You can find the commands here ../commands/README.md. The middle column has the command names. Not the leftmost column with the humand-readable command description. + +### Behavior + +LGSM will run the script and then continue without checking exit value. + From 1aeae0a2ca1c3071912268769ddf8f0435fa1538 Mon Sep 17 00:00:00 2001 From: Fernando Faria <1319357+ffariajr@users.noreply.github.com> Date: Tue, 29 Aug 2023 12:12:26 -0400 Subject: [PATCH 2/4] Update script-hooks.md --- configuration/script-hooks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configuration/script-hooks.md b/configuration/script-hooks.md index 6e700a4..62006fc 100644 --- a/configuration/script-hooks.md +++ b/configuration/script-hooks.md @@ -20,7 +20,7 @@ hook--.sh `` can have the values `pre`, `post`, or `error`. Post and error hooks are mutually exclusive and never run within the same command. -`` must match long command names. You can find the commands here ../commands/README.md. The middle column has the command names. Not the leftmost column with the humand-readable command description. +`` must match long command names. You can find the commands [here](../commands/README.md). The middle column has the command names. Not the leftmost column with the humand-readable command description. ### Behavior From a0e9c5a145d403d0d7558cf3e57d6a8cc4a946be Mon Sep 17 00:00:00 2001 From: Fernando Faria <1319357+ffariajr@users.noreply.github.com> Date: Tue, 29 Aug 2023 13:43:39 -0400 Subject: [PATCH 3/4] Update script-hooks.md --- configuration/script-hooks.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/configuration/script-hooks.md b/configuration/script-hooks.md index 62006fc..910f904 100644 --- a/configuration/script-hooks.md +++ b/configuration/script-hooks.md @@ -26,3 +26,6 @@ hook--.sh LGSM will run the script and then continue without checking exit value. +## Notes + +Don't forget to make the scripts executable! From 3edf2d290b1a5f5aff8c41f8bff05f7ecadbd153 Mon Sep 17 00:00:00 2001 From: Fernando Faria <1319357+ffariajr@users.noreply.github.com> Date: Tue, 29 Aug 2023 14:47:18 -0400 Subject: [PATCH 4/4] Update script-hooks.md --- configuration/script-hooks.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/configuration/script-hooks.md b/configuration/script-hooks.md index 910f904..44c4f8f 100644 --- a/configuration/script-hooks.md +++ b/configuration/script-hooks.md @@ -4,19 +4,11 @@ You can create scripts that run before, after, or after in case of error for any ## Hook Scripts Location -Relative to your installation directory, create a folder: - -``` -lgsm/hooks -``` +Relative to your installation directory, create a folder: `lgsm/hooks` ## Script Naming -Script hooks are named according to this convention: - -``` -hook--.sh -``` +Script hooks are named according to this convention: `hook--.sh` `` can have the values `pre`, `post`, or `error`. Post and error hooks are mutually exclusive and never run within the same command.