Start integrating Hugo in the new plugin

This commit is contained in:
Henrique Dias
2017-07-11 16:58:18 +01:00
parent 465b10a02a
commit 8b1d36dfb9
26 changed files with 837 additions and 2497 deletions

View File

@@ -22,7 +22,7 @@ var (
)
// command handles the requests for VCS related commands: git, svn and mercurial
func command(c *requestContext, w http.ResponseWriter, r *http.Request) (int, error) {
func command(c *RequestContext, w http.ResponseWriter, r *http.Request) (int, error) {
// Upgrades the connection to a websocket and checks for errors.
conn, err := upgrader.Upgrade(w, r, nil)
if err != nil {
@@ -51,7 +51,7 @@ func command(c *requestContext, w http.ResponseWriter, r *http.Request) (int, er
// Check if the command is allowed
allowed := false
for _, cmd := range c.us.Commands {
for _, cmd := range c.User.Commands {
if cmd == command[0] {
allowed = true
}
@@ -77,7 +77,7 @@ func command(c *requestContext, w http.ResponseWriter, r *http.Request) (int, er
}
// Gets the path and initializes a buffer.
path := string(c.us.FileSystem) + "/" + r.URL.Path
path := string(c.User.FileSystem) + "/" + r.URL.Path
path = filepath.Clean(path)
buff := new(bytes.Buffer)