]> git.donarmstrong.com Git - bin.git/blobdiff - stodo
make sa use the sa.d dir
[bin.git] / stodo
diff --git a/stodo b/stodo
old mode 100644 (file)
new mode 100755 (executable)
index d13fae7..0b133ca
--- a/stodo
+++ b/stodo
@@ -1,9 +1,9 @@
 #! /usr/bin/perl
-# ss makes a screenshot of the screen using import, and is released
-# under the terms of the GPL version 2, or any later version, at your
-# option. See the file README and COPYING for more information.
-# Copyright 2004 by Don Armstrong <don@donarmstrong.com>.
-# $Id: ss,v 1.3 2004/09/27 05:58:55 don Exp $
+# stodo commits the changes made to a subversion backed todo db, and
+# is released under the terms of the GPL version 2, or any later
+# version, at your option. See the file README and COPYING for more
+# information. Copyright 2004 by Don Armstrong <don@donarmstrong.com>.
+# $Id$
 
 
 use warnings;
@@ -54,6 +54,20 @@ Display this manual.
 
 =back
 
+=head1 ENVIRONMENTAL VARIABLES
+
+=over
+
+=item B<TODODB>
+
+Todo databse location, set by devtodo
+
+=item B<STODO_NO_COMMIT>
+
+If set, stodo assumes that there is no network, and doesn't commit
+
+=back
+
 =head1 EXAMPLES
 
  on save {
@@ -100,7 +114,7 @@ my $base_dir = dirname($tododb);
 my $tododb_name = basename($tododb);
 
 if (not -e "$base_dir/.svn") {
-     print "$base_dir/.svn doesns't exist, not commiting" unless $options{quiet};
+     print "$base_dir/.svn doesns't exist, not commiting\n" unless $options{quiet};
      exit 0;
 }
 
@@ -116,14 +130,17 @@ while (<$svn_entries_fh>) {
      $svn_host = $2;
      last;
 }
-
+if ($ENV{STODO_NO_COMMIT}) {
+     print "Exiting because of STODO_NO_COMMIT env variable\n" unless $options{quiet};
+     exit 0;
+}
 if (not defined $svn_host and $url_type ne 'file') {
      die "Was unable to find which host the svn repository is located on";
 }
 if ($url_type ne 'file') {
      qx(ping -q -c 3 $svn_host >/dev/null 2>&1);
      if ($? != 0) {
-         print "Unable to ping $svn_host" unless $options{quiet};
+         print "Unable to ping $svn_host\n" unless $options{quiet};
          exit 0 unless $options{simulate};
      }
 }