Merge pull request #138 from notzippy/develop

Re added the requirement for the -a, without this the flags would not…
This commit is contained in:
Steve
2018-09-22 15:32:30 -07:00
committed by GitHub
2 changed files with 7 additions and 7 deletions

View File

@@ -243,7 +243,7 @@ func Build(c *model.CommandConfig, paths *model.RevelContainer) (app *App, compi
utils.Logger.Info("Exec:", "args", getCmd.Args) utils.Logger.Info("Exec:", "args", getCmd.Args)
getOutput, err := getCmd.CombinedOutput() getOutput, err := getCmd.CombinedOutput()
if err != nil { if err != nil {
utils.Logger.Error("Build failed", "message", stOutput) utils.Logger.Error("Build failed", "message", stOutput, "error", err)
utils.Logger.Error("Failed to fetch the output", "getOutput", string(getOutput)) utils.Logger.Error("Failed to fetch the output", "getOutput", string(getOutput))
return nil, newCompileError(paths, output) return nil, newCompileError(paths, output)
} }

View File

@@ -47,13 +47,13 @@ type (
// The build command // The build command
Build struct { Build struct {
TargetPath string `short:"t" long:"target-path" description:"Path to target folder. Folder will be completely deleted if it exists" required:"true"` TargetPath string `short:"t" long:"target-path" description:"Path to target folder. Folder will be completely deleted if it exists" required:"true"`
ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" ` ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" required:"true"`
Mode string `short:"m" long:"run-mode" description:"The mode to run the application in"` Mode string `short:"m" long:"run-mode" description:"The mode to run the application in"`
CopySource bool `short:"s" long:"include-source" description:"Copy the source code as well"` CopySource bool `short:"s" long:"include-source" description:"Copy the source code as well"`
} `command:"build"` } `command:"build"`
// The run command // The run command
Run struct { Run struct {
ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" ` ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" required:"true"`
Mode string `short:"m" long:"run-mode" description:"The mode to run the application in"` Mode string `short:"m" long:"run-mode" description:"The mode to run the application in"`
Port string `short:"p" long:"port" description:"The port to listen"` Port string `short:"p" long:"port" description:"The port to listen"`
NoProxy bool `short:"n" long:"no-proxy" description:"True if proxy server should not be started. This will only update the main and routes files on change"` NoProxy bool `short:"n" long:"no-proxy" description:"True if proxy server should not be started. This will only update the main and routes files on change"`
@@ -61,17 +61,17 @@ type (
// The package command // The package command
Package struct { Package struct {
Mode string `short:"m" long:"run-mode" description:"The mode to run the application in"` Mode string `short:"m" long:"run-mode" description:"The mode to run the application in"`
ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" ` ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" required:"true"`
CopySource bool `short:"s" long:"include-source" description:"Copy the source code as well"` CopySource bool `short:"s" long:"include-source" description:"Copy the source code as well"`
} `command:"package"` } `command:"package"`
// The clean command // The clean command
Clean struct { Clean struct {
ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" ` ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" required:"true"`
} `command:"clean"` } `command:"clean"`
// The test command // The test command
Test struct { Test struct {
Mode string `short:"m" long:"run-mode" description:"The mode to run the application in"` Mode string `short:"m" long:"run-mode" description:"The mode to run the application in"`
ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" ` ImportPath string `short:"a" long:"application-path" description:"Path to applicaiton folder" required:"true"`
Function string `short:"f" long:"suite-function" description:"The suite.function"` Function string `short:"f" long:"suite-function" description:"The suite.function"`
} `command:"test"` } `command:"test"`
// The version command // The version command
@@ -133,6 +133,6 @@ func (c *CommandConfig) UpdateImportPath() bool {
} }
c.ImportPath = importPath c.ImportPath = importPath
utils.Logger.Info("Returned import path", "path", importPath) utils.Logger.Info("Returned import path", "path", importPath, "buildpath",build.Default.GOPATH)
return (len(importPath) > 0 || !required) return (len(importPath) > 0 || !required)
} }