diff --git a/bin/git+ b/bin/git+ index 82e0d59..fc2c9fd 100755 --- a/bin/git+ +++ b/bin/git+ @@ -1,8 +1,7 @@ #!/usr/bin/env bash -if [ $# -eq 0 ] -then - echo where is my commit message, bro? +if [ $# -eq 0 ]; then + echo 'Where is my commit message, bro?' exit 1 fi diff --git a/bin/hg+ b/bin/hg+ index 06d7d86..74c072c 100755 --- a/bin/hg+ +++ b/bin/hg+ @@ -1,36 +1,10 @@ -#!/usr/bin/env perl +#!/usr/bin/env bash -use strict; -use warnings; -use Cwd; +if [ $# -eq 0 ]; then + echo 'Where is my commit message, huh?' + exit 1 +fi -die 'please enter commit message' unless @ARGV; - -my $msg = join ' ', @ARGV; - -my $dir = getcwd(); - -system "hg --cwd $dir addremove"; -system "hg --cwd $dir commit -m '$msg'"; -system "hg --cwd $dir push"; - -my $hgrc = "$dir/.hg/hgrc"; - -open my $fh, '<', $hgrc - or die "cannot open $hgrc: $!\n"; - -my $repository; - -while (my $line = readline($fh)) { - if ($line =~ m/^bb\.prefix = (.+)$/) { - $repository = $1; - last; - } -} - -close $fh; - -if ($repository) { - print "\nview commits:\n"; - print "$repository/commits/all\n"; -} +hg addremove +hg commit -m ''"$*"'' +hg push