liverepl

Evaluer ses scripts en temps réel (dangereux ⚠️) - retour accueil

git clone git://bebou.netlib.re/liverepl
Log | Files | Refs | README |

commit c14cdad23113be323d55bfdb004bd0ab14a7921f
parent 83d779dec83ed17b5c3f362cc23ac006da2b7c2f
Auterice: Arthur Pons <arthur.pons@unistra.fr>
Date:   Thu, 29 Aug 2024 13:31:32 +0200

Gestion des pipeline qui n'existent pas

Ou sont cassés
On ne fait ni make ni exec ni print si la session tmux
n'existe pas ou si le dossier dans tmp n'existe pas
A priori on gère pas ça correctement pour create et join encore, à faire

Diffstat:
Mpipeline | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/pipeline b/pipeline @@ -21,7 +21,7 @@ create() { pipelineexists() { title="$1" - tmux ls | cut -d':' -f1 | grep -qE "^$title$" + tmux ls | cut -d':' -f1 | grep -qE "^$title$" && [ -d "/tmp/$title" ] } join() { @@ -31,30 +31,30 @@ join() { printp() { title="$1" - 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 + pipelineexists "$title" || { echo "pipeline doesn't exist"; exit 1; } + find /tmp/$title/ -name '*-cmd' | + sort | + xargs cat | + paste -s -d'|' | + sed 's/|/ | \n/g' } execute() { title="$1" + pipelineexists "$title" || { echo "pipeline doesn't exist"; exit 1; } printp "$title" | sh } makescript() { title="$1" + pipelineexists "$title" || { echo "pipeline doesn't exist"; exit 1; } [ -e "$title" ] \ && { echo "File already exists, won't overwrite" 1>&2; exit 1; } \ || { printp "$title" > $title; } chmod +x $title } + delete() { title="$1" tmux kill-session -t "$title"