From 1ae24a1a0a2df089ab23bed2bef883fa4601411a Mon Sep 17 00:00:00 2001
From: Santiago Lo Coco <santilococo.01@gmail.com>
Date: Tue, 18 Jan 2022 22:08:02 -0300
Subject: [PATCH] Update setLogToFile()

---
 scripts/bootstrap.sh | 2 +-
 scripts/common.sh    | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh
index 8bd1e8b..24846b2 100755
--- a/scripts/bootstrap.sh
+++ b/scripts/bootstrap.sh
@@ -25,7 +25,7 @@ checkParameters() {
             -l | --log)
                 checkForDependencies "libnewt"
                 setDialogBox "whiptail"
-                setLogToFile true
+                setLogToFile true "$(pwd -P)"
                 ;;
             -p | --packages) 
                 installPackages=true
diff --git a/scripts/common.sh b/scripts/common.sh
index b9d9d53..29dabeb 100644
--- a/scripts/common.sh
+++ b/scripts/common.sh
@@ -171,8 +171,9 @@ getDialogBox() {
 
 setLogToFile() {
     export logToFile=${1}
+    export logFolder=${2}
 }
 
 debug() {
-    [[ -z ${logToFile+x} || $logToFile = true ]] && tee -a sadedot.log > /dev/null
+    [[ -z ${logToFile+x} || $logToFile = true ]] && tee -a "$logFolder/sadedot.log" > /dev/null
 }