From 76db15fe824568be3908e530d8916072e2e1bb4f Mon Sep 17 00:00:00 2001 From: OniriCorpe Date: Fri, 4 Nov 2022 19:13:22 +0100 Subject: [PATCH] =?UTF-8?q?am=C3=A9liorations=20mineures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- genlog.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/genlog.sh b/genlog.sh index 1072244..0adcc0f 100755 --- a/genlog.sh +++ b/genlog.sh @@ -1,11 +1,18 @@ -#!/bin/bash +#!/usr/bin/env bash + +# quelques trucs intelligents +# https://sharats.me/posts/shell-script-best-practices/ +set -o errexit +set -o nounset +set -o pipefail + # on créé un répertoire de taff temporaire pour foutre nos fichiers en cours de traitement dedans tempdir="$(mktemp -d)" # on vérifie s'il y a un argument passé à notre script -if [ -n "$1" ] +if [[ -n "$1" ]] then # si oui, on l'utilise comme path ou aller taffer source_path="$1"