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:
parent
caeebc37f3
commit
30b2514b49
@ -207,10 +207,12 @@ public class WriteAs.MainWindow : Gtk.ApplicationWindow {
|
||||
out stdout, out stderr, out status);
|
||||
|
||||
// Open it in the browser
|
||||
var browser = AppInfo.get_default_for_uri_scheme("https");
|
||||
var urls = new List<string>();
|
||||
urls.append(stdout.strip());
|
||||
browser.launch_uris(urls, null);
|
||||
if (status == 0) {
|
||||
var browser = AppInfo.get_default_for_uri_scheme("https");
|
||||
var urls = new List<string>();
|
||||
urls.append(stdout.strip());
|
||||
browser.launch_uris(urls, null);
|
||||
}
|
||||
|
||||
return stderr.strip();
|
||||
} catch (Error err) {
|
||||
|
Loading…
Reference in New Issue
Block a user