updated credential docker
This commit is contained in:
parent
735f3f2c84
commit
6f49278e75
14
flist.v
14
flist.v
@ -124,6 +124,20 @@ fn logout() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_docker_credential() !string {
|
fn get_docker_credential() !string {
|
||||||
|
// Try to get the Docker credential automatically
|
||||||
|
credential := get_docker_credential_auto() or {
|
||||||
|
// If automatic retrieval fails, prompt the user for input
|
||||||
|
println(term.yellow('\nCouldn\'t find your Docker username automatically.'))
|
||||||
|
username := os.input('Please enter your Docker username and press ENTER: ')
|
||||||
|
if username.trim_space() == '' {
|
||||||
|
return error('No Docker username provided')
|
||||||
|
}
|
||||||
|
return username.trim_space()
|
||||||
|
}
|
||||||
|
return credential
|
||||||
|
}
|
||||||
|
|
||||||
|
fn get_docker_credential_auto() !string {
|
||||||
// Read the Docker config file
|
// Read the Docker config file
|
||||||
config_path := os.join_path(os.home_dir(), '.docker', 'config.json')
|
config_path := os.join_path(os.home_dir(), '.docker', 'config.json')
|
||||||
config_content := os.read_file(config_path) or {
|
config_content := os.read_file(config_path) or {
|
||||||
|
Loading…
Reference in New Issue
Block a user