Only open browser on successful publish

This checks the returned error code from `writeas` and skips the browser
opening if the status != 0.
This commit is contained in:
Matt Baer 2018-04-19 15:43:28 -04:00
parent caeebc37f3
commit 30b2514b49

View File

@ -207,10 +207,12 @@ public class WriteAs.MainWindow : Gtk.ApplicationWindow {
out stdout, out stderr, out status); out stdout, out stderr, out status);
// Open it in the browser // Open it in the browser
var browser = AppInfo.get_default_for_uri_scheme("https"); if (status == 0) {
var urls = new List<string>(); var browser = AppInfo.get_default_for_uri_scheme("https");
urls.append(stdout.strip()); var urls = new List<string>();
browser.launch_uris(urls, null); urls.append(stdout.strip());
browser.launch_uris(urls, null);
}
return stderr.strip(); return stderr.strip();
} catch (Error err) { } catch (Error err) {