about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-08-08 18:42:29 -0400
committerCharadon <dev@iotib.net>2022-08-08 18:43:18 -0400
commit63f551f21fb77d25405cc74683e6dccab2ba192c (patch)
treef0a92fc114d79905f02cc3b75eda0decd8bf64c2
parentfd147a36a9622923a4d1cde29b1fc06ebaf727f9 (diff)
downloaddscip-63f551f21fb77d25405cc74683e6dccab2ba192c.tar.gz
Updated README and added a check for LAST_COMMIT
-rw-r--r--README3
-rwxr-xr-xdscip7
2 files changed, 8 insertions, 2 deletions
diff --git a/README b/README
index ae0980f..b70ed7c 100644
--- a/README
+++ b/README
@@ -9,3 +9,6 @@ Gitlab-ci and Jenkins. This script was also made to be as POSIX compliant as
 possible, so it should run on basically every platform with a POSIX shell.
 
 Refer to the docs folder for how to use DSCIP.
+
+1.0 will probably be released once I'm sure most if not all bugs are gone.
+Which is swiftly approaching.
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