-
Notifications
You must be signed in to change notification settings - Fork 4
/
dev.go
39 lines (31 loc) · 1011 Bytes
/
dev.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package devtool
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"github.com/project-flogo/cli/common"
"github.com/spf13/cobra"
)
var descCmd = &cobra.Command{
Use: "dev",
Short: "Developer tool for basic work ",
Long: `This command helps you to work flogo contributions `,
PersistentPreRun: func(cmd *cobra.Command, args []string) {},
Run: func(cmd *cobra.Command, args []string) {
},
}
var GOPATH string
var COREPATH string
func init() {
common.RegisterPlugin(descCmd)
GOPATH = os.Getenv("GOPATH")
if _, err := os.Stat(filepath.Join(GOPATH, "pkg", "mod", "github.com", "project-flogo", "core@v0.9.0", "examples")); os.IsNotExist(err) {
os.Setenv("GO111MODULE", "on")
err = exec.Command("go", "get", "github.com/project-flogo/core@v0.9.0").Run()
if err != nil {
fmt.Printf("Error in getting 0.9.0 version of the core %v \n", err)
}
}
COREPATH = filepath.Join(GOPATH, "pkg", "mod", "github.com", "project-flogo", "core@v0.9.0", "examples")
}