Skip to content

Commit 0e0453d

Browse files
committed
Fiddling with paths
1 parent 4c66ca0 commit 0e0453d

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Main.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,22 @@ Write-TimedMessage "Minimizing Administrator window" -StartNewStep
8686
Minimize-Window "Administrator: C:\actions"
8787
Write-TimedMessage "Window minimized"
8888

89-
89+
$originalSrcDir = $srcDir
9090

9191
foreach ($folder in $folders) {
92+
Write-Host "========================="
93+
# Reset the source directory to the original value
94+
$srcDir = $originalSrcDir
95+
9296
Write-TimedMessage "Processing folder: $folder" -StartNewStep
9397
$fileExtension = $folder.Substring($folder.LastIndexOf('.') + 1)
98+
Write-Host "File extension: $fileExtension"
9499
$app = Get-OfficeApp -FileExtension $fileExtension
95100

96101
$ext = ""
97102
if ($app -ne "Access") {
98103
$ext = "zip"
99-
Write-TimedMessage "Creating Zip file and renaming to Office document target" -StartNewStep
104+
Write-TimedMessage "Creating Zip file and renaming to Office document target with path ${srcDir}${folder}" -StartNewStep
100105
. "$PSScriptRoot/scripts/Zip-It.ps1" "${srcDir}${folder}"
101106
Write-TimedMessage "Zip file created"
102107
}
@@ -116,6 +121,8 @@ foreach ($folder in $folders) {
116121
$buildVbaScriptPath = "$PSScriptRoot/scripts/Build-VBA.ps1"
117122
$success = Invoke-ScriptWithTimeout -ScriptPath $buildVbaScriptPath -Arguments @("${srcDir}${folder}", "$app") -TimeoutSeconds 30
118123

124+
Write-Host "srcDir: ${srcDir}"
125+
119126
if (-not $success) {
120127
Write-TimedMessage "🔴 Build-VBA.ps1 execution timed out or failed for ${folder}. Continuing with next file..."
121128

scripts/Zip-It.ps1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ if (-not $docDirPath) {
66
Write-Host "Error: No docDirPath specified. Usage: Zip-It.ps1 <docDirPath>"
77
exit 1
88
}
9+
Write-Host "docDirPath: $docDirPath"
10+
11+
# Import utility functions
12+
$scriptPath = Split-Path -Parent $MyInvocation.MyCommand.Path
13+
. "$scriptPath/utils/Path.ps1"
914

1015
$currentDir = (Get-Location).Path + "/"
1116
Write-Host "Current directory: $currentDir"

0 commit comments

Comments
 (0)