diff options
-rw-r--r-- | save.pl | 19 | ||||
-rw-r--r-- | save.pl~ | 15 |
2 files changed, 21 insertions, 13 deletions
@@ -33,8 +33,7 @@ added(0) :- bold)), send(D, append, new(E, editor)), send(D, append, button(save, - and(message(@prolog, save, E, C), - message(D, destroy)))), + message(@prolog, save, E, C))), send(D, append, button(cancel, and(message(@prolog, reset), message(D, destroy)))), @@ -82,8 +81,14 @@ chain_atom_x(C, A0, A) :- ). commit(Msg) :- - setup_call_cleanup( - process_create(path(git), ['commit', '-m', Msg], - [detached(true)]), - true, - true). + process_create(path(git), ['commit', '-m', Msg], + [process(PID)]), + process_wait(PID, S), + commited(S). + +commited(1) :- + send(@display, report, error, + 'Files could not be saved.'). + +commited(0) :- + halt. @@ -33,8 +33,7 @@ added(0) :- bold)), send(D, append, new(E, editor)), send(D, append, button(save, - and(message(@prolog, save, E, C), - message(D, destroy)))), + message(@prolog, save, E, C))), send(D, append, button(cancel, and(message(@prolog, reset), message(D, destroy)))), @@ -82,7 +81,11 @@ chain_atom_x(C, A0, A) :- ). commit(Msg) :- - setup_call_cleanup( - process_create(path(git), ['commit', '-m', Msg], [detached(true)]), - true, - true). + process_create(path(git), ['commit', '-m', Msg], + [process(PID)]), + process_wait(PID, S). + +added(1) :- + send(@display, report, error, + 'Files could not be added to index. +Ensure Git is in PATH.'). |