nettoyage
parent
a99b1f4f9e
commit
9f0ad6c81d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue