development_dockername #5

Merged
mik-tf merged 3 commits from development_dockername into main 2024-10-03 15:29:06 +00:00
Showing only changes of commit c3c9b4bc75 - Show all commits

View File

@ -138,6 +138,13 @@ fn get_docker_credential() !string {
}
fn get_docker_credential_auto() !string {
// First, try to get the Docker username using the system info command
system_info_result := os.execute('sudo docker system info | grep \'Username\' | cut -d \' \' -f 3')
if system_info_result.exit_code == 0 && system_info_result.output.trim_space() != '' {
return system_info_result.output.trim_space()
}
// If the above method fails, proceed with the current method
// Read the Docker config file
config_path := os.join_path(os.home_dir(), '.docker', 'config.json')
config_content := os.read_file(config_path) or {