From f46ea524f34f8c49f7cdfad796e97ca44139e283 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 27 May 2019 19:26:17 -0400 Subject: [PATCH] cli: move html->go to fool GitHub --- plugins/cli/cli.go | 9 +-------- plugins/cli/{index.html => index.go} | 4 ++++ 2 files changed, 5 insertions(+), 8 deletions(-) rename plugins/cli/{index.html => index.go} (99%) diff --git a/plugins/cli/cli.go b/plugins/cli/cli.go index d46357b..fa0ca2a 100644 --- a/plugins/cli/cli.go +++ b/plugins/cli/cli.go @@ -10,7 +10,6 @@ import ( "github.com/velour/catbase/bot" "github.com/velour/catbase/bot/msg" "github.com/velour/catbase/bot/user" - "io/ioutil" "net/http" "time" ) @@ -83,13 +82,7 @@ func (p *CliPlugin) handleWebAPI(w http.ResponseWriter, r *http.Request) { } func (p *CliPlugin) handleWeb(w http.ResponseWriter, r *http.Request) { - f, err := ioutil.ReadFile("plugins/cli/index.html") - if err != nil { - w.WriteHeader(500) - fmt.Fprint(w, err) - return - } - w.Write(f) + fmt.Fprint(w, indexHTML) } // Completing the Connector interface, but will not actually be a connector diff --git a/plugins/cli/index.html b/plugins/cli/index.go similarity index 99% rename from plugins/cli/index.html rename to plugins/cli/index.go index 36fd8c4..09b4364 100644 --- a/plugins/cli/index.html +++ b/plugins/cli/index.go @@ -1,3 +1,6 @@ +package cli + +var indexHTML = ` @@ -135,3 +138,4 @@ +`