Skip to content

Commit 9f7dee7

Browse files
author
Max Siegieda
authored
Merge branch 'master' into fix/deployment-not-found-error
2 parents 79f4d49 + 081740c commit 9f7dee7

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

cmd/graph.go

+14-3
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ This attempts to use your default pdf viewer to open the graph.
4444
Run: openGraph,
4545
}
4646

47+
var errInvalidGraphSourceDirectory = errors.New("Invalid source directory. Directory must have a main.go file")
48+
4749
func init() {
4850
graphCmd.AddCommand(
4951
graphCmdGenerate,
@@ -56,14 +58,15 @@ func init() {
5658
}
5759

5860
func generateGraph(cmd *cobra.Command, args []string) {
59-
if !validBuildDir(srcDir) {
60-
exitWithError(errInvalidSourceDirectory)
61+
if !validGraphDir(srcDir) {
62+
exitWithError(errInvalidGraphSourceDirectory)
6163
}
6264
id, err := tool.Graph().Generate(reco.Args{srcDir})
6365
if err != nil {
6466
exitWithError(interpretErrorGraph(err))
6567
}
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")
6770
}
6871

6972
func openGraph(_ *cobra.Command, args []string) {
@@ -101,3 +104,11 @@ func interpretErrorGraph(err error) error {
101104
return err
102105
}
103106
}
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+
}

0 commit comments

Comments
 (0)