From 665896a04a1c16cf00e6f87b70963b23630facd0 Mon Sep 17 00:00:00 2001 From: crownedgrouse Date: Thu, 9 Apr 2020 15:22:09 +0200 Subject: [PATCH] Amend README --- README.md | 29 ++++++++++++++++++++++++++++- mk/esh.mk | 13 +++++++++---- plugins.mk | 3 ++- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ae1ad98..32bdf77 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ This is an erlang.mk plugin to use the `esh` template engine. See [esh project](https://github.com/jirutka/esh) and [esh man page](https://github.com/jirutka/esh/blob/master/esh.1.adoc) . +This plugin can be used to generate any Erlang file which content can depends of OS or environment. + ## Install ```make @@ -22,11 +24,26 @@ dep_esh.mk = git https://github.com/crownedgrouse/esh.mk master # for branch ma include erlang.mk ``` +## Usage + +Once esh plugin declared in your project's Makefile, simply run : + +```shell +$> make esh +``` +First call will show the wget command output to download `esh` tarball. If some proxy parameters are needed, considere use of [`wgetrc` file](https://www.gnu.org/software/wget/manual/html_node/Startup-File.html#Startup-File). + +Any file with suffix `.esh` found under project's root directory will be treated and a target file generated in same directory with same name without `.esh` suffix. +For instance : +- `.config` files +- `vm.args` file + +No output is displayed unless a syntax error occurs. In such case error will be printed. ## Override environment variables -If environment variables need to be overidden, variable `ESH_VARS` can be used. +If environment variables need to be overridden, variable `ESH_VARS` can be used. Declaration can to be done before make command, or set in `Makefile` file. ```shell @@ -40,3 +57,13 @@ ESH_VARS="logs_dir=/var/log tmp_dir=/tmp " include erlang.mk ``` +See also next section Help for other esh variables. + +## Help + +Using erlang.mk `help` target will tell you than target `esh_help` will output `esh` script help. This help will show you other variables available to tune `esh`. + +## Force update/install + +In order to force install or update again, considere removing `.erlang.mk/esh.mk/` and `deps/esh.mk/` directories. + diff --git a/mk/esh.mk b/mk/esh.mk index cdfb24d..fd8352e 100644 --- a/mk/esh.mk +++ b/mk/esh.mk @@ -1,8 +1,9 @@ # # ESH template engine plugin for Erlang.mk # Licence : https://github.com/crownedgrouse/esh.mk/blob/master/LICENCE -# Author : Eric Pailleau -# +# Author : Eric Pailleau -# +# Version : 1.0.0 help:: @printf "%s\n" " esh Apply esh template engine plugin" + @printf "%s\n" " esh_help Help of esh template engine" THIS := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))