about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-07-14 04:20:32 -0400
committerCharadon <dev@iotib.net>2022-07-14 04:20:32 -0400
commite842afeffc4c183024773e430e1bd659cac85d2d (patch)
tree6b771f7b8a0290694e8f5ac31bd9d97dae94f0fa
parentfbccc58abece3004b7d4912d5df331292db6dcaf (diff)
downloaddscip-e842afeffc4c183024773e430e1bd659cac85d2d.tar.gz
Moved the logging of variables to AFTER it's confirmed a build is happening.
-rwxr-xr-xdscip41
1 files changed, 22 insertions, 19 deletions
diff --git a/dscip b/dscip
index 61208a0..19a4e84 100755
--- a/dscip
+++ b/dscip
@@ -33,7 +33,7 @@ fi
 # Check if script is currently running, and if not, reset LOCK #
 if [ -f "$WORKING_DIRECTORY/LOCK" ]; then
 	LOCKED_PID=$(cat "$WORKING_DIRECTORY/LOCK")
-	if ps -p "$LOCKED_PID"; then
+	if ps -p "$LOCKED_PID" > /dev/null; then
 		echo "Script still running. Exiting..."
 		exit 0
 	else
@@ -44,26 +44,29 @@ fi
 
 echo "$$" > "$WORKING_DIRECTORY/LOCK"
 
-# Print variables
-{
-echo "################################################################################";
-date;
-echo "################################################################################";
-echo "DSCIP_GITREPO=$DSCIP_GITREPO";
-echo "DSCIP_GITMODE=$DSCIP_GITMODE";
-echo "DSCIP_BRANCH=$DSCIP_BRANCH";
-echo "WORKING_DIRECTORY=$WORKING_DIRECTORY";
-echo "DSCIP_PRE_CMD=$DSCIP_PRE_CMD";
-echo "DSCIP_BUILD_CMD=$DSCIP_BUILD_CMD";
-echo "DSCIP_POST_CMD=$DSCIP_POST_CMD";
-echo "DSCIP_DAEMON=$DSCIP_DAEMON";
-echo "DSCIP_DAEMON_FORK=$DSCIP_DAEMON_FORK";
-echo "DSCIP_SLEEP=$DSCIP_SLEEP";
-echo "DSCIP_DISREGARD_COMMIT_CHECK=$DSCIP_DISREGARD_COMMIT_CHECK";
-echo "DSCIP_OUTPUT_TO=$DSCIP_OUTPUT_TO"
-} >> "$DSCIP_OUTPUT_TO"
+
 
 build () {
+	# Print variables #
+	{
+		echo "################################################################################";
+		date;
+		echo "################################################################################";
+		echo "DSCIP_GITREPO=$DSCIP_GITREPO";
+		echo "DSCIP_GITMODE=$DSCIP_GITMODE";
+		echo "DSCIP_BRANCH=$DSCIP_BRANCH";
+		echo "WORKING_DIRECTORY=$WORKING_DIRECTORY";
+		echo "DSCIP_PRE_CMD=$DSCIP_PRE_CMD";
+		echo "DSCIP_BUILD_CMD=$DSCIP_BUILD_CMD";
+		echo "DSCIP_POST_CMD=$DSCIP_POST_CMD";
+		echo "DSCIP_DAEMON=$DSCIP_DAEMON";
+		echo "DSCIP_DAEMON_FORK=$DSCIP_DAEMON_FORK";
+		echo "DSCIP_SLEEP=$DSCIP_SLEEP";
+		echo "DSCIP_DISREGARD_COMMIT_CHECK=$DSCIP_DISREGARD_COMMIT_CHECK";
+		echo "DSCIP_OUTPUT_TO=$DSCIP_OUTPUT_TO"
+	} >> "$DSCIP_OUTPUT_TO"
+
+	# Grab remote sources #
 	if [ "$DSCIP_GITMODE" = "clone" ]; then
 		rm -rf "$WORKING_DIRECTORY/wrkdir" # Clean Up #
 		git clone --depth 1 -b "$DSCIP_BRANCH" "$DSCIP_GITREPO" wrkdir >> "$DSCIP_OUTPUT_TO" 2>&1 # Clone git #