Skip to content

Commit 2c7e91a

Browse files
authored
Merge pull request #35 from itowlson/accept-new-cloud-plugin-output
Accept new format of output from `spin cloud deploy`
2 parents 3ee5470 + ce098d2 commit 2c7e91a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/cloud_gpu_info.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,21 @@ pub(crate) struct CloudGpuInfo {
1313
}
1414

1515
fn extract_url(input: &str) -> String {
16-
let Ok(re) = Regex::new(r"fermyon-cloud-gpu: (https://[^\s]+)") else {
16+
let Ok(re_new) = Regex::new(r"View application: (https://[^\s]+)") else {
1717
return String::from(FALLBACK_URL);
1818
};
19-
let Some(captures) = re.captures(input) else {
19+
if let Some(captures) = re_new.captures(input) {
20+
return captures[1].to_string();
21+
}
22+
23+
let Ok(re_old) = Regex::new(r"fermyon-cloud-gpu: (https://[^\s]+)") else {
2024
return String::from(FALLBACK_URL);
2125
};
22-
captures[1].to_string()
26+
if let Some(captures) = re_old.captures(input) {
27+
return captures[1].to_string();
28+
};
29+
30+
String::from(FALLBACK_URL)
2331
}
2432

2533
impl CloudGpuInfo {

0 commit comments

Comments
 (0)