浏览代码

added tf workspace in command environment variable

bmallred 10 年之前
父节点
当前提交
c1bfcb2a41
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      cmd/app.go

+ 2 - 3
cmd/app.go

6
	"io"
6
	"io"
7
	"os"
7
	"os"
8
	"os/exec"
8
	"os/exec"
9
	"path"
9
	"strings"
10
	"strings"
10
)
11
)
11
12
45
46
46
		"CODE_TF_ADD":      "add",
47
		"CODE_TF_ADD":      "add",
47
		"CODE_TF_CHECK":    "branches .",
48
		"CODE_TF_CHECK":    "branches .",
48
		"CODE_TF_INCOMING": "history -r -stopafter:1 -version:W~T .",
49
		"CODE_TF_INCOMING": fmt.Sprintf("history -r -stopafter:1 -version:W%s~T .", path.Base(GetWorkingDirectory())),
49
		"CODE_TF_MERGE":    "merge",
50
		"CODE_TF_MERGE":    "merge",
50
		"CODE_TF_MV":       "rename",
51
		"CODE_TF_MV":       "rename",
51
		"CODE_TF_PULL":     "get -preview",
52
		"CODE_TF_PULL":     "get -preview",
138
	}
139
	}
139
140
140
	// Execute the command and swallow any output
141
	// Execute the command and swallow any output
141
	//var out bytes.Buffer
142
	actions := strings.Split(env, " ")
142
	actions := strings.Split(env, " ")
143
	cmd := exec.Command(vcs, actions...)
143
	cmd := exec.Command(vcs, actions...)
144
	//cmd.Stdout = &out
145
144
146
	return cmd.Run()
145
	return cmd.Run()
147
}
146
}