Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions internal/setup/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func Create() error {

println()

// confirm
// confirm create new project
var ok bool
err := survey.AskOne(&survey.Confirm{
Message: fmt.Sprintf("No up.json found, create a new project?"),
Expand Down Expand Up @@ -106,7 +106,30 @@ func Create() error {
}

b, _ := json.MarshalIndent(c, "", " ")
return ioutil.WriteFile("up.json", b, 0644)
err = ioutil.WriteFile("up.json", b, 0644)
if err != nil {
return err
}

// confirm create .upignore
term.MoveUp(1)
term.ClearLine()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this required? (L115-L116)

term.MoveUp(1)
term.ClearLine()

Copy link
Contributor Author

@hhsnopek hhsnopek Jan 7, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed in 1303216, which fixes the codeclimate tests 😂

err = survey.AskOne(&survey.Confirm{
Message: fmt.Sprintf("Would you like to add an .upignore?"),
Default: true,
}, &ok, nil)

if err != nil {
return nil
}

if !ok {
return errors.New("aborted")
}

defaultIgnore := ".*\n"
b = []byte(defaultIgnore)
return ioutil.WriteFile(".upignore", b, 0644)
}

// defaultName returns the default app name.
Expand Down