Skip to content

Commit f759a75

Browse files
committed
refactor: merge two for loops
1 parent e33fe0b commit f759a75

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

cmd/create.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,13 @@ func createParentAlias(fs afero.Fs, cp CreatePrompts) (CreatePrompts, error) {
177177
return CreatePrompts{}, readDirErr
178178
}
179179

180-
var projectPaths []string
181180
for _, file := range files {
182-
if file.Name() != ".DS_Store" {
183-
projectPaths = append(projectPaths, pathRes+"/"+file.Name())
181+
if file.Name() == ".DS_Store" {
182+
continue
184183
}
185-
}
186184

187-
for _, projectPath := range projectPaths {
185+
projectPath := pathRes + "/" + file.Name()
186+
188187
aliasRes, aliasErr := ui.Input(ui.InputProps{Title: fmt.Sprintf("Alias for (%s) Leave blank to skip.", projectPath)})
189188
if aliasErr != nil {
190189
return CreatePrompts{}, aliasErr

0 commit comments

Comments
 (0)