push output gives new flist url created

This commit is contained in:
mik-tf 2024-10-02 12:19:55 -04:00
parent ea1dc9a5f3
commit 949162579d

13
flist.v
View File

@ -172,6 +172,19 @@ fn push(tag string) {
if response.status_code == 200 { if response.status_code == 200 {
println('Request successful. Response body:') println('Request successful. Response body:')
println(response.body) println(response.body)
// Get the hub username to construct the flist URL
hub_user := get_hub_username(tfhub_token) or {
error_message('Failed to get hub username')
exit(1)
}
// Construct the flist URL
flist_name := tag.replace(':', '-') + '.flist'
flist_url := 'https://hub.grid.tf/$hub_user/$flist_name'
println('\nFlist URL:')
println(flist_url)
} else { } else {
eprintln('Request failed with status code: ${response.status_code}') eprintln('Request failed with status code: ${response.status_code}')
eprintln('Response body:') eprintln('Response body:')