From 9f0ad6c81d34a31ab463a9d20c1cc04f529c12af Mon Sep 17 00:00:00 2001 From: Izimic Date: Sat, 28 Nov 2020 16:54:53 +0100 Subject: [PATCH] nettoyage --- src/webhooksd.cr | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/webhooksd.cr b/src/webhooksd.cr index d88dc50..b69cd96 100644 --- a/src/webhooksd.cr +++ b/src/webhooksd.cr @@ -3,9 +3,11 @@ require "option_parser" require "./payload.cr" VERSION = 0.1 -port = 3000 +port = 3000 storage = "webhooksd-data" +scriptfile = "on-push" +jsonfile = "payload.json" args = [] of String @@ -16,7 +18,7 @@ OptionParser.parse do |parser| exit end - parser.on "-h", "--help", "Show help" do + parser.on "-h", "--help", "Show help" do puts parser exit end @@ -45,9 +47,6 @@ OptionParser.parse do |parser| end end -scriptfile = "on-push" -jsonfile = "payload.json" - server = HTTP::Server.new do |context| if context.request.method != "POST" || context.request.path != "/" context.response.status = HTTP::Status::NOT_FOUND @@ -69,7 +68,7 @@ server = HTTP::Server.new do |context| status = false else File.write(path_jsonfile, payload.content) - status = Process.run command: "sh", args: [scriptfile], shell: true, + status = Process.run command: "zsh", args: [scriptfile], shell: true, error: STDERR, output: STDOUT, chdir: path_project end end