-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alexandre Bourget
committed
Jun 3, 2022
1 parent
9f7418d
commit fb9c955
Showing
9 changed files
with
48 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/streamingfast/substreams/manifest" | ||
) | ||
|
||
var graphCmd = &cobra.Command{ | ||
Use: "graph <manifest_file>", | ||
Short: "Generate mermaid-js graph document", | ||
RunE: runManifestGraph, | ||
Args: cobra.ExactArgs(1), | ||
SilenceUsage: true, | ||
} | ||
|
||
func init() { | ||
rootCmd.AddCommand(graphCmd) | ||
} | ||
|
||
func runManifestGraph(cmd *cobra.Command, args []string) error { | ||
manifestPath := args[0] | ||
manifestReader := manifest.NewReader(manifestPath) | ||
pkg, err := manifestReader.Read() | ||
if err != nil { | ||
return fmt.Errorf("read manifest %q: %w", manifestPath, err) | ||
} | ||
|
||
manifest.PrintMermaid(pkg.Modules) | ||
|
||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters