From 067e9814f077ca8ea2068ee4cf46449770d69d86 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Thu, 13 Oct 2016 10:02:05 -0700 Subject: adding delete button (test) --- cmd/ponzu/main.go | 4 ++++ cmd/ponzu/options.go | 19 +++++++++++++++++++ management/editor/editor.go | 15 ++++++++++++++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/cmd/ponzu/main.go b/cmd/ponzu/main.go index 39fa173..ee5ae1f 100644 --- a/cmd/ponzu/main.go +++ b/cmd/ponzu/main.go @@ -72,6 +72,9 @@ generate, gen, g : var ( port int tls bool + + // for ponzu internal / core development + dev bool ) func init() { @@ -83,6 +86,7 @@ func init() { func main() { flag.IntVar(&port, "port", 8080, "port for ponzu to bind its listener") flag.BoolVar(&tls, "tls", false, "enable automatic TLS/SSL certificate management") + flag.BoolVar(&dev, "dev", false, "modify environment for Ponzu core development") flag.Parse() args := flag.Args() diff --git a/cmd/ponzu/options.go b/cmd/ponzu/options.go index 19b61bb..bc96b42 100644 --- a/cmd/ponzu/options.go +++ b/cmd/ponzu/options.go @@ -214,6 +214,25 @@ func createProjInDir(path string) error { return err } + if dev { + devClone := exec.Command("git", "clone", local, "--branch", "ponzu-dev", "--single-branch", path) + devClone.Stdout = os.Stdout + devClone.Stderr = os.Stderr + + err := devClone.Start() + if err != nil { + return err + } + + err = devClone.Wait() + if err != nil { + return err + } + + fmt.Println("Dev build cloned from bosssauce/ponzu:ponzu-dev") + return nil + } + // try to git clone the repository from the local machine's $GOPATH localClone := exec.Command("git", "clone", local, path) localClone.Stdout = os.Stdout diff --git a/management/editor/editor.go b/management/editor/editor.go index 5e26740..ed684fd 100644 --- a/management/editor/editor.go +++ b/management/editor/editor.go @@ -46,10 +46,23 @@ func Form(post Editable, fields ...Field) ([]byte, error) { addPostDefaultFieldsToEditorView(post, editor) submit := ` -
+
+
+ + ` + editor.ViewBuf.Write([]byte(submit + ``)) return editor.ViewBuf.Bytes(), nil -- cgit v1.2.3