about summary refs log tree commit diff stats
path: root/dscip
diff options
context:
space:
mode:
Diffstat (limited to 'dscip')
-rwxr-xr-xdscip7
1 files changed, 5 insertions, 2 deletions
diff --git a/dscip b/dscip
index de733e7..d27c9cc 100755
--- a/dscip
+++ b/dscip
@@ -114,12 +114,15 @@ run () {
 	# Loads last commit hash if it exists. # 
 	if [ -f "$WORKING_DIRECTORY/LAST_COMMIT" ]; then
 		LAST_COMMIT="$(cat "$WORKING_DIRECTORY/LAST_COMMIT")"
-		export LAST_COMMIT
+		if [ -z "$LAST_COMMIT" ]; then # Check if LAST_COMMIT was grabbed successfully.
+			return 0
+		fi
 	fi
+	export LAST_COMMIT
 
 	# Loads current commit hash #
 	CURRENT_COMMIT=$(git ls-remote "$DSCIP_GITREPO" | awk "/refs\/(heads|tags)\/$DSCIP_BRANCH/{print \$1}")
-	if [ -z "$CURRENT_COMMIT" ]; then
+	if [ -z "$CURRENT_COMMIT" ]; then # Checks if CURRENT_COMMIT is blank, if so, abort script.
 		return 0
 	fi
 	export CURRENT_COMMIT
3'>113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171