File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -118,8 +118,12 @@ var newProjectCmd = &cobra.Command{
118
118
path , err := filepath .Abs (path )
119
119
if err != nil {
120
120
return err
121
- } else if ok , _ := afero .Exists (mail .AppFs , path ); ok {
122
- return newUserError ("%s already exists" , path )
121
+ }
122
+
123
+ // Check for config to see if a project exists
124
+ configPath := filepath .Join (path , "config.toml" )
125
+ if ok , _ := afero .Exists (mail .AppFs , configPath ); ok {
126
+ return newUserError ("%s already contains a project" , path )
123
127
}
124
128
125
129
// Create project directories
@@ -130,7 +134,6 @@ var newProjectCmd = &cobra.Command{
130
134
}
131
135
132
136
// Write basic configuration
133
- configPath := filepath .Join (path , "config.toml" )
134
137
if err := writeTemplate (configPath , configTemplate , nil , true ); err != nil {
135
138
return err
136
139
}
You can’t perform that action at this time.
0 commit comments