-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Implement a very simple command to dump parsed recipe/cookbook data, to make debugging easier in the absence of nicer data validation stuff * Sometimes vscode doesn't save your file contents! That is fine and normal! * test + provisional bugfix * gofumpt * fix this test * fix the regex...
- Loading branch information
1 parent
4cc5ad9
commit e86c828
Showing
5 changed files
with
63 additions
and
6 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
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,25 @@ | ||
package cmd | ||
|
||
import ( | ||
"github.com/spf13/cobra" | ||
|
||
"github.com/Pylons-tech/pylons/x/pylons/types" | ||
) | ||
|
||
func DevParse() *cobra.Command { | ||
cmd := &cobra.Command{ | ||
Use: "parse [path]", | ||
Short: "Parses all Pylons recipe or cookbook files in the provided path and processes macros", | ||
Args: cobra.ExactArgs(1), | ||
Run: func(cmd *cobra.Command, args []string) { | ||
path := args[0] | ||
// This is slightly goofy but it's the fastest/least invasive way to implement this behavior right now. | ||
// We just set a flag to output the assembled JSON and then let the batch handler run with empty callbacks. | ||
// Down the road it'd be nice to have something a little nicer, but this is enough as-is to make debugging more | ||
// manageable. | ||
Verbose = true | ||
ForFiles(path, func(path string, cookbook types.Cookbook) {}, func(path string, recipe types.Recipe) {}) | ||
}, | ||
} | ||
return cmd | ||
} |
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