mirror of
https://github.com/Threnklyn/jira.git
synced 2026-05-18 20:23:28 +02:00
handle editor having arguments
This commit is contained in:
@@ -18,7 +18,7 @@ export GOPATH=$(shell pwd)
|
||||
|
||||
build:
|
||||
cd src/github.com/Netflix-Skunkworks/go-jira/jira; \
|
||||
go install -v
|
||||
go get -v
|
||||
|
||||
all:
|
||||
mkdir -p $(DIST); \
|
||||
@@ -28,3 +28,6 @@ all:
|
||||
echo "Building for $$p"; \
|
||||
GOOS=$${p/-*/} GOARCH=$${p/*-/} go build -v -o $(DIST)/jira-$$p; \
|
||||
done
|
||||
|
||||
fmt:
|
||||
gofmt -s -w jira
|
||||
|
||||
+5
-2
@@ -4,6 +4,7 @@ import (
|
||||
"bytes"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/kballard/go-shellquote"
|
||||
"github.com/op/go-logging"
|
||||
"gopkg.in/yaml.v2"
|
||||
"io/ioutil"
|
||||
@@ -247,8 +248,10 @@ func (c *Cli) editTemplate(template string, tmpFilePrefix string, templateData m
|
||||
|
||||
for true {
|
||||
if editing {
|
||||
log.Debug("Running: %s %s", editor, tmpFileName)
|
||||
cmd := exec.Command(editor, tmpFileName)
|
||||
shell, _ := shellquote.Split(editor)
|
||||
shell = append(shell, tmpFileName)
|
||||
log.Debug("Running: %#v", shell)
|
||||
cmd := exec.Command(shell[0], shell[1:]...)
|
||||
cmd.Stdout, cmd.Stderr, cmd.Stdin = os.Stdout, os.Stderr, os.Stdin
|
||||
if err := cmd.Run(); err != nil {
|
||||
log.Error("Failed to edit template with %s: %s", editor, err)
|
||||
|
||||
Reference in New Issue
Block a user