From 07350bc3e60497de5ed8d2238579f561735cb298 Mon Sep 17 00:00:00 2001 From: un1c0rn Date: Tue, 17 Jan 2012 10:49:31 +0100 Subject: [PATCH] add a git reset to rebuild --- mod.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/mod.c b/mod.c index aa5e8e4..92554cb 100644 --- a/mod.c +++ b/mod.c @@ -880,12 +880,18 @@ static void command_inspect(struct bio *b, const char *nick, const char *host, c static void command_rebuild(struct bio *b, const char *nick, const char *host, const char *target, char *args) { int ret; - char *argv[] = { "/usr/bin/make", "-j8", NULL }; + char *make[] = { "/usr/bin/make", "-j4", NULL }; + char *git_reset[] = { "/usr/bin/git", "git", "reset", "--hard", "origin/master", NULL }; if (!admin(host)) { privmsg(b, target, "%s: { You do not fool me, Rari...bot! }", nick); return; } - ret = pipe_command(b, target, nick, 0, 1, argv); + ret = pipe_command(b, target, nick, 0, 1, git_reset); + if (ret) { + action(b, target, "could not rebuild"); + return; + } + ret = pipe_command(b, target, nick, 0, 1, make); if (!ret) kill(getpid(), SIGUSR1); else if (ret > 0) -- 2.11.4.GIT