Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #151: Destroy command is always run #163

Merged
merged 3 commits into from Oct 19, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion apps/destroy.go
Expand Up @@ -10,13 +10,19 @@ import (

func Destroy(appName string) error {
var validationName string

res, err := scalingo.AppsShow(appName)
Copy link
Member

Choose a reason for hiding this comment

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

res is not used, please use _

if err != nil {
return errgo.Mask(err, errgo.Any)
}

fmt.Printf("/!\\ You're going to delete %s, this operation is irreversible.\nTo confirm type the name of the application: ", appName)
fmt.Scan(&validationName)
if validationName != appName {
return errgo.Newf("'%s' is not '%s', aborting…\n", validationName, appName)
}

res, err := scalingo.AppsDestroy(appName, validationName)
res, err = scalingo.AppsDestroy(appName, validationName)
if err != nil {
return errgo.Notef(err, "fail to destroy app")
}
Expand Down