Commit 9f7dee7 Max Siegieda
authored
File tree 1 file changed +14
-3
lines changed
1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,8 @@ This attempts to use your default pdf viewer to open the graph.
44
44
Run : openGraph ,
45
45
}
46
46
47
+ var errInvalidGraphSourceDirectory = errors .New ("Invalid source directory. Directory must have a main.go file" )
48
+
47
49
func init () {
48
50
graphCmd .AddCommand (
49
51
graphCmdGenerate ,
@@ -56,14 +58,15 @@ func init() {
56
58
}
57
59
58
60
func generateGraph (cmd * cobra.Command , args []string ) {
59
- if ! validBuildDir (srcDir ) {
60
- exitWithError (errInvalidSourceDirectory )
61
+ if ! validGraphDir (srcDir ) {
62
+ exitWithError (errInvalidGraphSourceDirectory )
61
63
}
62
64
id , err := tool .Graph ().Generate (reco.Args {srcDir })
63
65
if err != nil {
64
66
exitWithError (interpretErrorGraph (err ))
65
67
}
66
- logger .Std .Println (id )
68
+ logger .Std .Println ("Graph submitted. Run 'reco graph list' to track the status of your graph" )
69
+ logger .Std .Println ("Once the graph has been completed run 'reco graph open " + id + "' to view it" )
67
70
}
68
71
69
72
func openGraph (_ * cobra.Command , args []string ) {
@@ -101,3 +104,11 @@ func interpretErrorGraph(err error) error {
101
104
return err
102
105
}
103
106
}
107
+
108
+ func validGraphDir (srcDir string ) bool {
109
+ // Do we have a main.go to graph?
110
+ if ! hasMain (srcDir ) {
111
+ return false
112
+ }
113
+ return true
114
+ }
You can’t perform that action at this time.
0 commit comments