From 7959d55d68651fad60977ba531586d7ca2230aa1 Mon Sep 17 00:00:00 2001
From: Adar Nimrod <nimrod@shore.co.il>
Date: Sun, 28 Apr 2019 14:44:22 +0300
Subject: [PATCH] Allow more fields in .prerun files.

---
 .bashrc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.bashrc b/.bashrc
index 589e73b..e09de94 100644
--- a/.bashrc
+++ b/.bashrc
@@ -240,7 +240,8 @@ __run_duration () {
     then
         local endtime starttime
         endtime="$(date +%s)"
-        starttime="$(cat "$HOME/.prerun.$$")"
+        # shellcheck disable=SC1090
+        . "$HOME/.prerun.$$"
         rm "$HOME/.prerun.$$"
         echo "$(( endtime - starttime ))"
     else
@@ -249,7 +250,7 @@ __run_duration () {
 }
 
 __prerun () {
-    date +%s > "$HOME/.prerun.$$"
+    echo "starttime=$(date +%s)" > "$HOME/.prerun.$$"
 }
 
 __prompt () {
-- 
GitLab