From 18e0d633c687d0aaafa3523cc44e38bec0591b5f Mon Sep 17 00:00:00 2001 From: sandrews Date: Mon, 15 Sep 2025 12:31:02 -0500 Subject: [PATCH] Refactor Update-Scripts function to create temporary directory in script folder and update .gitignore for new paths --- .gitignore | 16 ++++++++++++++++ 1_Install.ps1 | 4 ++-- 2_ConfigUpdate.ps1 | 4 ++-- 3_ConfigAfterNextcloud.ps1 | 4 ++-- 4 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..797f762 --- /dev/null +++ b/.gitignore @@ -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 diff --git a/1_Install.ps1 b/1_Install.ps1 index fbc3b48..9d82684 100644 --- a/1_Install.ps1 +++ b/1_Install.ps1 @@ -41,8 +41,8 @@ function Update-Scripts { } } - # Create a temporary directory to download files - $tempDir = Join-Path -Path $env:TEMP -ChildPath "windows-install-update" + # Create a temporary directory in the script folder (will be ignored by git) + $tempDir = Join-Path -Path $updateScriptDir -ChildPath "temp" if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force } New-Item -ItemType Directory -Path $tempDir -Force | Out-Null diff --git a/2_ConfigUpdate.ps1 b/2_ConfigUpdate.ps1 index fbe62a6..1b5c5ff 100644 --- a/2_ConfigUpdate.ps1 +++ b/2_ConfigUpdate.ps1 @@ -41,8 +41,8 @@ function Update-Scripts { } } - # Create a temporary directory to download files - $tempDir = Join-Path -Path $env:TEMP -ChildPath "windows-install-update" + # Create a temporary directory in the script folder (will be ignored by git) + $tempDir = Join-Path -Path $updateScriptDir -ChildPath "temp" if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force } New-Item -ItemType Directory -Path $tempDir -Force | Out-Null diff --git a/3_ConfigAfterNextcloud.ps1 b/3_ConfigAfterNextcloud.ps1 index 39fe926..1e67d96 100644 --- a/3_ConfigAfterNextcloud.ps1 +++ b/3_ConfigAfterNextcloud.ps1 @@ -41,8 +41,8 @@ function Update-Scripts { } } - # Create a temporary directory to download files - $tempDir = Join-Path -Path $env:TEMP -ChildPath "windows-install-update" + # Create a temporary directory in the script folder (will be ignored by git) + $tempDir = Join-Path -Path $updateScriptDir -ChildPath "temp" if (Test-Path $tempDir) { Remove-Item $tempDir -Recurse -Force } New-Item -ItemType Directory -Path $tempDir -Force | Out-Null