]> gitweb.fluxo.info Git - scripts.git/commitdiff
Replace 'ztd' script by 'status' and 'done'
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 14 May 2017 16:58:28 +0000 (13:58 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 14 May 2017 16:58:28 +0000 (13:58 -0300)
done [new file with mode: 0755]
status
ztd [deleted file]

diff --git a/done b/done
new file mode 100755 (executable)
index 0000000..6e95bbd
--- /dev/null
+++ b/done
@@ -0,0 +1,24 @@
+#!/bin/bash
+#
+# Submit updates to a project.
+#
+
+# Parameters
+PROJECT="$1"
+
+# Try to get there
+if [ ! -z "$PROJECT" ]; then
+  cd $PROJECT &> /dev/null || exit 1
+fi
+
+# Sync
+if git status &> /dev/null; then
+  if which updates > /dev/null; then
+    updates
+  else
+    git commit -a -m "Updates $PROJECT"
+    git push
+  fi
+
+  git fetch --all
+fi
diff --git a/status b/status
index b12e83bc3feda6cff325debe05d3ce04cabf9ad4..98a11f000353aba0b6471e63be2ed05210862d4c 100755 (executable)
--- a/status
+++ b/status
@@ -1,6 +1,37 @@
 #!/bin/bash
 #
-# Check project status using mr.
+# Check the overall status of your work.
 #
 
-mrconfig-updater && mr -m status
+# Parameters
+PROJECT="$1"
+
+# Dispatch
+if [ ! -z "$PROJECT" ]; then
+  # Check the status of the given project
+  cd $PROJECT &> /dev/null && git status
+else
+  # Ensure we are in the home folder
+  cd
+
+  # Check your reminders
+  if [ -e "$HOME/.reminders" ]; then
+    remind ~/.reminders | grep -v '^No reminders.$'
+  fi
+
+  # Update your mrconfig and check all registered repositories
+  mrconfig-updater && mr -m status
+
+  # Check your TODO lists
+  todo
+
+  # Check if you have mails to send
+  postponed
+
+  # Check if are dangling downloaded files
+  if [ -e "$HOME/load" ] && [ ! -z "`ls -1 ~/load/`" ]; then
+    echo "Dangling files at ~/load:"
+    echo ""
+    ls -lh ~/load/
+  fi
+fi
diff --git a/ztd b/ztd
deleted file mode 100755 (executable)
index 7d3add8..0000000
--- a/ztd
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-#
-# ZTD extension to commit, push and fetch a project.
-#
-
-# Parameters
-PROJECT="$1"
-
-# Try to get there
-if [ ! -z "$PROJECT" ]; then
-  cd $PROJECT &> /dev/null
-elif ! git status &> /dev/null; then
-  cd
-  remind ~/.reminders | grep -v '^No reminders.$'
-  status
-  todo
-  postponed
-
-  if [ ! -z "`ls -1 ~/load/`" ]; then
-    echo "Dangling files at ~/load:"
-    echo ""
-    ls -lh ~/load/
-  fi
-
-  exit
-fi
-
-# Sync
-if git status &> /dev/null; then
-  if which updates > /dev/null; then
-    updates
-  else
-    git commit -a -m "Updates $PROJECT"
-    git push
-  fi
-
-  git fetch --all
-fi