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

#15 Make username required field and remove default #17

Merged
merged 1 commit into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 4 additions & 7 deletions src/commands/config.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ fn do(_input: CommandInput) {
current -> " 'current=" <> int.to_string(current) <> "'"
}
let current_username =
" 'default=me'"
"*"
<> case current_base_config.username {
// Default username is me
"me" -> ""
// Empty string is the default therefore don't show it
"" -> ""
current -> " 'current=" <> current <> "'"
}
let current_https =
Expand All @@ -69,10 +69,7 @@ fn do(_input: CommandInput) {
default: Some(current_base_config.port),
)
let username =
terminal.prompt(
"Enter your username" <> current_username,
default: Some(current_base_config.username),
)
terminal.prompt("Enter your username" <> current_username, default: None)
let https =
terminal.confirm(
"Do you use HTTPS?" <> current_https,
Expand Down
2 changes: 1 addition & 1 deletion src/util/env.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn init_config_file() -> Result(Nil, FileError) {
case file_exists {
True -> Ok(Nil)
False ->
// Create the config file (This will an empty config file)
// Create the config file (This will be an empty config file)
// To fill this file the user needs to run through the prompt generation
simplifile.create_file("./" <> name_of_config_file)
}
Expand Down
Loading