From befcf2ab2ca4e80eebcbd839ce4a0375ae9a6012 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Thu, 13 Jul 2017 12:32:18 +0200 Subject: [PATCH] graceful exit: fix #5 --- Makefile | 2 +- cloogle.icl | 2 +- run.sh | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 09cf707..4be80d8 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ CLMLIBS:=\ -I ~/projects/gast/Libraries\ -I ./libcloogle -BINARIES:=IRC cloogle test +BINARIES:=IRC cloogle #test all: $(BINARIES) diff --git a/cloogle.icl b/cloogle.icl index c4c93d9..b2c7bdf 100644 --- a/cloogle.icl +++ b/cloogle.icl @@ -117,6 +117,7 @@ Start w = bot ("irc.freenode.net", 6667) startup shutdown () process w process` :: (Maybe (Either IRCUser String)) IRCCommand *World -> (Maybe [IRCCommand], *World) process` (Just (Left user)) (PRIVMSG t m) w + | m == "!restart" = (Nothing, w) | m.[0] == '!' # (msgs, w) = realProcess (split " " $ m % (1, size m)) w = (Just $ map (PRIVMSG recipient) msgs, w) @@ -157,7 +158,6 @@ Start w = bot ("irc.freenode.net", 6667) startup shutdown () process w realProcess ["query":xs] w = case xs of [] = (["query requires one or more arguments"], w) xs = appFst (split "\n") $ cloogle (join " " xs) w - realProcess ["restart"] w = abort "Restarted" realProcess ["restart":_] w = (["restart takes no arguments"], w) realProcess [c:_] w = ([join " " [ "Unknown cmd: ", c, ", type !help to get help"]], w) diff --git a/run.sh b/run.sh index 14f41d6..83639f6 100644 --- a/run.sh +++ b/run.sh @@ -1,6 +1,7 @@ #!/bin/sh while true do + git pull origin master make ./cloogle sleep 5s -- 2.20.1