diff --git a/v2/cmd/wails/internal/commands/initialise/templates/templates.go b/v2/cmd/wails/internal/commands/initialise/templates/templates.go index 59174268..ea69a8ce 100644 --- a/v2/cmd/wails/internal/commands/initialise/templates/templates.go +++ b/v2/cmd/wails/internal/commands/initialise/templates/templates.go @@ -169,23 +169,10 @@ func Install(options *Options) (bool, *Template, error) { // Did the user want to install in current directory? if options.TargetDir == "" { - - // If the current directory is empty, use it - isEmpty, err := fs.DirIsEmpty(cwd) - if err != nil { - return false, nil, err + options.TargetDir = filepath.Join(cwd, options.ProjectName) + if fs.DirExists(options.TargetDir) { + return false, nil, fmt.Errorf("cannot create project directory. Dir exists: %s", options.TargetDir) } - - if isEmpty { - // Yes - use cwd - options.TargetDir = cwd - } else { - options.TargetDir = filepath.Join(cwd, options.ProjectName) - if fs.DirExists(options.TargetDir) { - return false, nil, fmt.Errorf("cannot create project directory. Dir exists: %s", options.TargetDir) - } - } - } else { // Get the absolute path of the given directory targetDir, err := filepath.Abs(filepath.Join(cwd, options.TargetDir))