Evaluer ses scripts en temps réel (dangereux ⚠️) - retour accueil
git clone git://bebou.netlib.re/liverepl
Log | Files | Refs | README |
commit 83d779dec83ed17b5c3f362cc23ac006da2b7c2f parent ae407c2a29b943126b3b8a5c085dd03af3b65f50 Auterice: Arthur Pons <arthur.pons@unistra.fr> Date: Thu, 29 Aug 2024 13:18:13 +0200 Supression d'un pipeline Aussi, gestion de l'affichage d'un pipeline s'il n'existe pas Diffstat:
M | pipeline | | | 21 | ++++++++++++++++----- |
1 file changed, 16 insertions(+), 5 deletions(-)
diff --git a/pipeline b/pipeline @@ -31,11 +31,15 @@ join() { printp() { title="$1" - find /tmp/$title/ -name '*-cmd' | - sort | - xargs cat | - paste -s -d'|' | - sed 's/|/ | \n/g' + if [ -d "/tmp/$title" ];then + find /tmp/$title/ -name '*-cmd' | + sort | + xargs cat | + paste -s -d'|' | + sed 's/|/ | \n/g' + else + echo "pipeline folder doesn't exist" + fi } execute() { @@ -51,6 +55,12 @@ makescript() { chmod +x $title } +delete() { + title="$1" + tmux kill-session -t "$title" + rm -rf /tmp/$title +} + [ -z "$t" ] && { echo "Missing pipeline title, give it with -t flag"; exit 1; } case "${c:-join}" in @@ -59,6 +69,7 @@ case "${c:-join}" in (print) printp $t ;; (exec*) execute $t ;; (make) makescript $t ;; + (del*) delete $t ;; (*) echo "command doesn't exist";; esac