Skip to content

Commit

Permalink
#15 Make username required field and remove default
Browse files Browse the repository at this point in the history
  • Loading branch information
harrisonhoward committed May 17, 2024
1 parent c156cd7 commit ec6ac54
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
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

0 comments on commit ec6ac54

Please sign in to comment.