Enhancements to Revel command

Reformat of code
Allow user to use a mix of command line arguments and flags
Enhance the import tool to detect missing packages in the modules side
Added test cases for all commands
This commit is contained in:
NotZippy
2018-09-27 21:08:40 -07:00
parent 01ccd695d4
commit f4fb2ec091
65 changed files with 2014 additions and 1281 deletions

View File

@@ -14,14 +14,14 @@ import (
)
var cmdClean = &Command{
UsageLine: "clean -i [import path]",
UsageLine: "clean [import path]",
Short: "clean a Revel application's temp files",
Long: `
Clean the Revel web application named by the given import path.
For example:
revel clean -a github.com/revel/examples/chat
revel clean github.com/revel/examples/chat
It removes the app/tmp and app/routes directory.
@@ -46,7 +46,7 @@ func updateCleanConfig(c *model.CommandConfig, args []string) bool {
}
// Clean the source directory of generated files
func cleanApp(c *model.CommandConfig) {
func cleanApp(c *model.CommandConfig) (err error) {
appPkg, err := build.Import(c.ImportPath, "", build.FindOnly)
if err != nil {
utils.Logger.Fatal("Abort: Failed to find import path:", "error", err)
@@ -65,4 +65,5 @@ func cleanApp(c *model.CommandConfig) {
return
}
}
return err
}