From 9d63ca99d03ce3116cd5e6ed92bda2b4753b51f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Gon=C3=A7alves?= Date: Tue, 25 Apr 2023 20:24:29 +0200 Subject: feat(bin): use common sha256 executable --- bin/func | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'bin/func') diff --git a/bin/func b/bin/func index bea9dea..0468b29 100644 --- a/bin/func +++ b/bin/func @@ -22,6 +22,12 @@ date_default_timezone="+0200" uname=$(uname) +__sha256="sha256" + +if [ "${uname}" = "Linux" ]; then + __sha256="sha256sum" +fi + __to_html_id() { cat /dev/stdin | sed 's/ /%20/g' } @@ -96,7 +102,7 @@ __get_out_filename() { _filename="${1}" if $(__get_value "${1}" draft || false); then - _filename="$(dirname ${1})/$(basename ${1} | sha256).html" + _filename="$(dirname ${1})/$(basename ${1} | "${__sha256}").html" fi echo "${_filename}" | -- cgit v1.2.3