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

Melhoria na remoção de ambientes (mesas) #8

Closed
Rudigus opened this issue Apr 3, 2020 · 1 comment
Closed

Melhoria na remoção de ambientes (mesas) #8

Rudigus opened this issue Apr 3, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@Rudigus
Copy link

Rudigus commented Apr 3, 2020

Substituir o if let para o while let, para quando o usuário digitar algo diferente de "y" e "n", aparecer entrada inválida. Isso é importante, pois o usuário pode ter digitado uma entrada diferente da esperada, às vezes sem querer.

Antes:

print("Are you sure about delete the \"\(env)\" environment? [y/n]", terminator: " ")
        if let confirm = readLine() {
            if confirm == "y" {
                core.deleteFile(fileName: env)
            }
        }
        return

Depois:

print("Are you sure about delete the \"\(env)\" environment? [y/n]", terminator: " ")
while let confirm = readLine() {
        switch confirm {
        case "y":
                core.deleteFile(fileName: env)
                //print("The environment was successfully deleted")
                return
        case "n":
                //print("Deletion canceled")
                return
        default:
                //print("Invalid command. (y/n)")
        }
}

Os prints comentados são opcionais.

Sugestão feita por Rudigus e Nathália.

@pedro0x53 pedro0x53 added the enhancement New feature or request label Apr 3, 2020
@pedro0x53
Copy link
Owner

Melhoria feita!
Se possível checar alteração na branch dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants