From df74077eb65238de8a792fa0b8b7dc9d2d16f2a5 Mon Sep 17 00:00:00 2001 From: Mario Alegre Date: Tue, 16 Feb 2021 17:43:29 -0500 Subject: [PATCH] made wrapper for esh --- debian/Containerfile | 3 ++- debian/assets/bin/esh | 20 ++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100755 debian/assets/bin/esh diff --git a/debian/Containerfile b/debian/Containerfile index eb632be..779f2b4 100644 --- a/debian/Containerfile +++ b/debian/Containerfile @@ -38,4 +38,5 @@ COPY assets/bin/ /usr/local/bin/ # Install templating engine RUN wget https://raw.githubusercontent.com/jirutka/esh/master/esh && \ chmod +x esh && \ - mv esh /usr/local/bin/ + mkdir -p /usr/local/lib/esh && \ + mv esh /usr/local/lib/esh diff --git a/debian/assets/bin/esh b/debian/assets/bin/esh new file mode 100755 index 0000000..bf272a5 --- /dev/null +++ b/debian/assets/bin/esh @@ -0,0 +1,20 @@ +#!/bin/bash + +esh=/usr/local/lib/esh/esh + +if [[ $# -gt 2 ]]; then + $esh "$@" +else + if [[ $# -eq 2 ]]; then + out="$2" + elif [[ $1 == *.esh ]]; then + out="${1%.esh}" + else + out='-' + fi +fi + +$esh -o "$out" "$1" + +chmod $(stat -c '%a' "$1") "$out" +chown $(stat -c '%U:%G' "$1") "$out"