Refactor Update-Scripts function to create temporary directory in script folder and update .gitignore for new paths

This commit is contained in:
2025-09-15 12:31:02 -05:00
parent ef2b9e2a94
commit 18e0d633c6
4 changed files with 22 additions and 6 deletions

16
.gitignore vendored Normal file
View File

@@ -0,0 +1,16 @@
# Ignore temporary directory used by update scripts
/temp/
/windows-install/
# Other common files to ignore
*.zip
last_update_check.txt
# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

View File

@@ -41,8 +41,8 @@ function Update-Scripts {
} }
} }
# Create a temporary directory to download files # Create a temporary directory in the script folder (will be ignored by git)
$tempDir = Join-Path -Path $env:TEMP -ChildPath "windows-install-update" $tempDir = Join-Path -Path $updateScriptDir -ChildPath "temp"
if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force } if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force }
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null New-Item -ItemType Directory -Path $tempDir -Force | Out-Null

View File

@@ -41,8 +41,8 @@ function Update-Scripts {
} }
} }
# Create a temporary directory to download files # Create a temporary directory in the script folder (will be ignored by git)
$tempDir = Join-Path -Path $env:TEMP -ChildPath "windows-install-update" $tempDir = Join-Path -Path $updateScriptDir -ChildPath "temp"
if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force } if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force }
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null New-Item -ItemType Directory -Path $tempDir -Force | Out-Null

View File

@@ -41,8 +41,8 @@ function Update-Scripts {
} }
} }
# Create a temporary directory to download files # Create a temporary directory in the script folder (will be ignored by git)
$tempDir = Join-Path -Path $env:TEMP -ChildPath "windows-install-update" $tempDir = Join-Path -Path $updateScriptDir -ChildPath "temp"
if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force } if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force }
New-Item -ItemType Directory -Path $tempDir -Force | Out-Null New-Item -ItemType Directory -Path $tempDir -Force | Out-Null