From ccf4e4fbbf8c555cb5b8bf4e624c03f57052918d Mon Sep 17 00:00:00 2001
From: dam1n19 <dam1n19@soton.ac.uk>
Date: Wed, 5 Jul 2023 15:29:41 +0100
Subject: [PATCH] Added ability to allow forcing of reinitialisation of socinit

---
 bin/project_setup.sh | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/bin/project_setup.sh b/bin/project_setup.sh
index dd9dd06..1b073e5 100755
--- a/bin/project_setup.sh
+++ b/bin/project_setup.sh
@@ -9,6 +9,7 @@
 # Copyright  2023, SoC Labs (www.soclabs.org)
 #-----------------------------------------------------------------------------
 #!/bin/bash
+OPTIND=1
 
 # Get Root Location of Design Structure
 if [ -z $SOCLABS_DESIGN_ROOT ]; then
@@ -67,8 +68,20 @@ else
     export PATH
 fi
 
+# Parse Command line options
+force=false
+while getopts "f" arg; do
+    case $arg in
+        f) # Force socinit
+            force=true
+            echo "Forcing Reinitialisation of Project"
+            ;;
+    esac
+done
+
+
 # Check cloned repository has been initialised
-if [ ! -f $SOCLABS_PROJECT_DIR/.socinit ]; then
+if [ ! -f $SOCLABS_PROJECT_DIR/.socinit ] || [ $force = true ]; then
     echo "Running First Time Repository Initialisation"
     # Source environment variables for all submodules
     cd $SOCLABS_DESIGN_ROOT
-- 
GitLab