mirror of
https://github.com/kevin-DL/revel-cmd.git
synced 2026-01-11 18:54:31 +00:00
Remove abort with 'revel new' on empty directory
If you use 'revel new ...' on an empty directory, revel will abort complaining the directory exists. With this commit, it will no longer abort if the directory is empty.
This commit is contained in:
@@ -148,9 +148,13 @@ func setApplicationPath(args []string) {
|
||||
importPath)
|
||||
}
|
||||
|
||||
appPath = filepath.Join(srcRoot, filepath.FromSlash(importPath))
|
||||
|
||||
_, err = build.Import(importPath, "", build.FindOnly)
|
||||
if err == nil {
|
||||
errorf("Abort: Import path %s already exists.\n", importPath)
|
||||
if !empty(appPath) {
|
||||
errorf("Abort: Import path %s already exists.\n", importPath)
|
||||
}
|
||||
}
|
||||
|
||||
revelPkg, err = build.Import(revel.RevelImportPath, "", build.FindOnly)
|
||||
@@ -158,7 +162,6 @@ func setApplicationPath(args []string) {
|
||||
errorf("Abort: Could not find Revel source code: %s\n", err)
|
||||
}
|
||||
|
||||
appPath = filepath.Join(srcRoot, filepath.FromSlash(importPath))
|
||||
appName = filepath.Base(appPath)
|
||||
basePath = filepath.ToSlash(filepath.Dir(importPath))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user