diff --git a/Version Control.accda.src/modules/clsLog.cls b/Version Control.accda.src/modules/clsLog.cls index 809f1cf6..cdaccb1b 100644 --- a/Version Control.accda.src/modules/clsLog.cls +++ b/Version Control.accda.src/modules/clsLog.cls @@ -13,6 +13,7 @@ Option Explicit Public PadLength As Integer Public ErrorLevel As eErrorLevel Public OperationType As eOperationType +Public SourcePath As String ' Set this to true when logging an operation such as an export or build ' then set back to false after writing the log file. This affects @@ -308,7 +309,7 @@ Public Property Get LogFilePath() As String Case eotMerge: strFile = "Merge.log" Case Else: strFile = "Other.log" End Select - LogFilePath = FSO.BuildPath(Options.GetExportFolder, strFile) + LogFilePath = FSO.BuildPath(Me.SourcePath, strFile) End Property diff --git a/Version Control.accda.src/modules/modImportExport.bas b/Version Control.accda.src/modules/modImportExport.bas index ad66108f..e36f63eb 100644 --- a/Version Control.accda.src/modules/modImportExport.bas +++ b/Version Control.accda.src/modules/modImportExport.bas @@ -59,9 +59,13 @@ Public Sub ExportSource(blnFullExport As Boolean, Optional intFilter As eContain Options.LoadProjectOptions Log.Clear Log.OperationType = eotExport + Log.SourcePath = Options.GetExportFolder Log.Active = True Perf.StartTiming + ' Check error handling mode after loading project options + If DebugMode(True) Then On Error GoTo 0 Else On Error Resume Next + ' If options (or VCS version) have changed, a full export will be required If (VCSIndex.OptionsHash <> Options.GetHash) Then blnFullExport = True @@ -313,9 +317,13 @@ Public Sub ExportSingleObject(objItem As AccessObject, Optional frmMain As Form_ Options.LoadProjectOptions Log.Clear Log.OperationType = eotExport + Log.SourcePath = Options.GetExportFolder Log.Active = True Perf.StartTiming + ' Check error handling mode after loading project options + If DebugMode(True) Then On Error GoTo 0 Else On Error Resume Next + ' Display heading With Log .Spacer @@ -482,9 +490,13 @@ Public Sub ExportMultipleObjects(objItems As Dictionary, Optional bolForceClose Options.LoadProjectOptions Log.Clear Log.OperationType = eotExport + Log.SourcePath = Options.GetExportFolder Log.Active = True Perf.StartTiming + ' Check error handling mode after loading project options + If DebugMode(True) Then On Error GoTo 0 Else On Error Resume Next + ' Display heading With Log .Spacer @@ -736,10 +748,13 @@ Public Sub Build(strSourceFolder As String, blnFullBuild As Boolean, _ End If End If + ' Load options from project Set Options = Nothing Options.LoadOptionsFromFile StripSlash(strSourceFolder) & PathSep & "vcs-options.json" ' Override the export folder when exporting to an alternate path. If Len(strAlternatePath) Then Options.ExportFolder = strSourceFolder + ' Update VBA debug mode after loading options + If DebugMode(True) Then On Error GoTo 0 Else On Error Resume Next ' Build original file name for database If blnFullBuild Then @@ -771,6 +786,7 @@ Public Sub Build(strSourceFolder As String, blnFullBuild As Boolean, _ ' Start log and performance timers Log.Clear Log.OperationType = IIf(blnFullBuild, eotBuild, eotMerge) + Log.SourcePath = strSourceFolder Log.Active = True Perf.StartTiming @@ -1120,9 +1136,13 @@ Public Sub LoadSingleObject(cComponentClass As IDbComponent, strName As String, Options.LoadProjectOptions Log.Clear Log.OperationType = eotMerge + Log.SourcePath = Options.GetExportFolder Log.Active = True Perf.StartTiming + ' Check error handling mode after loading project options + If DebugMode(True) Then On Error GoTo 0 Else On Error Resume Next + ' Display heading With Log .Spacer @@ -1235,9 +1255,13 @@ Public Sub MergeAllSource() Options.LoadProjectOptions Log.Clear Log.OperationType = eotMerge + Log.SourcePath = Options.GetExportFolder Log.Active = True Perf.StartTiming + ' Check error handling mode after loading project options + If DebugMode(True) Then On Error GoTo 0 Else On Error Resume Next + ' Display heading With Log .Spacer