Mercurial > hg > Members > anatofuz > slides
changeset 8:0b502eb897cc
add message
author | Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 25 Jan 2018 17:11:08 +0900 |
parents | 7d3faa099bc6 |
children | 80cee8f70ae8 |
files | lib/Slideshow/Util.pm |
diffstat | 1 files changed, 20 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/Slideshow/Util.pm Thu Jan 25 17:01:05 2018 +0900 +++ b/lib/Slideshow/Util.pm Thu Jan 25 17:11:08 2018 +0900 @@ -96,6 +96,7 @@ $target //= 'slide.md'; + say "[AUTO] BUILD at $dir/$target"; local $CWD = $dir; @@ -111,27 +112,38 @@ sub upload { + say "[AUTO]hg addremove"; my ($stdout,$stderr,$exit) = capture { system("hg addremove"); system("hg add"); }; - unless($stderr){ - say $stdout; - } else { - croak "didn't commit"; + if ($stderr) { + croak "didn't add"; } + say "[AUTO]hg commit -m auto-Update generated slides by script"; + ($stdout,$stderr,$exit) = capture { system('hg commit -m "auto-Update generated slides by script"'); }; - unless($stderr){ - say "$stdout"; + if ($stderr) { + say $stderr; + croak "didn't commit"; + } + + say "[AUTO]hg push"; + + ($stdout,$stderr,$exit) = capture { system('hg push'); - } else { + }; + + if ( $stderr ) { say $stderr; - croak "didn't push"; + croak "didn't commit"; + } else { + say $stdout; } }