mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-11-26 07:26:18 +01:00
refactor: move development scripts from Scripts to Tools directory (#881)
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
BeforeAll {
|
||||
$repositoryRoot = Split-Path -Parent $PSScriptRoot
|
||||
$buildScript = Join-Path $repositoryRoot 'Scripts/Build-Release.ps1'
|
||||
$buildScript = Join-Path $repositoryRoot 'Tools/Build-Release.ps1'
|
||||
$releasePath = Join-Path $TestDrive 'release'
|
||||
$version = '2026.10.22-r2'
|
||||
$originalScript = [IO.File]::ReadAllText((Join-Path $repositoryRoot 'Win11Debloat.ps1'))
|
||||
Push-Location $TestDrive
|
||||
try { & $buildScript -SourcePath $repositoryRoot -Version $version -OutputDirectory 'release' }
|
||||
try { & $buildScript -Version $version -OutputDirectory 'release' }
|
||||
finally { Pop-Location }
|
||||
$unpackedPath = Join-Path $TestDrive 'unpacked'
|
||||
Expand-Archive -LiteralPath (Join-Path $releasePath 'Win11Debloat.zip') -DestinationPath $unpackedPath
|
||||
@@ -29,7 +29,7 @@ Describe 'Release packaging' {
|
||||
}
|
||||
|
||||
It 'excludes development files and existing user data' {
|
||||
foreach ($path in 'Tests', '.github', '.git', '.gitignore', 'Logs', 'Backups', 'Scripts/Run-Tests.ps1', 'Scripts/Build-Release.ps1', 'LastUsedSettings.json', 'Config/LastUsedSettings.json') {
|
||||
foreach ($path in 'Tests', 'Tools', '.github', '.git', '.gitignore', 'Logs', 'Backups', 'LastUsedSettings.json', 'Config/LastUsedSettings.json') {
|
||||
Test-Path -LiteralPath (Join-Path $packagePath $path) | Should -BeFalse
|
||||
}
|
||||
}
|
||||
@@ -43,12 +43,12 @@ Describe 'Release packaging' {
|
||||
|
||||
It 'includes new files automatically and prunes exclusions and nested output' {
|
||||
$source = Join-Path $TestDrive 'source-fixture'
|
||||
foreach ($directory in 'NewRuntime', 'Scripts', 'Tests', '.git', '.github', 'Logs', 'Backups', 'Config') {
|
||||
foreach ($directory in 'NewRuntime', 'Scripts', 'Tools', 'Tests', '.git', '.github', 'Logs', 'Backups', 'Config') {
|
||||
New-Item -ItemType Directory -Path (Join-Path $source $directory) -Force | Out-Null
|
||||
}
|
||||
Copy-Item -LiteralPath (Join-Path $repositoryRoot 'Win11Debloat.ps1') -Destination $source
|
||||
Copy-Item -LiteralPath (Join-Path $repositoryRoot 'Scripts/Get.ps1') -Destination (Join-Path $source 'Scripts/Get.ps1')
|
||||
foreach ($path in 'extra.txt', 'NewRuntime/data.txt', 'Scripts/NewHelper.ps1', 'Tests/test.txt', '.git/config', '.github/workflow.yml', '.gitignore', 'Logs/log.txt', 'Backups/backup.json', 'Scripts/Build-Release.ps1', 'Scripts/Run-Tests.ps1', 'LastUsedSettings.json', 'Config/LastUsedSettings.json') {
|
||||
foreach ($path in 'extra.txt', 'NewRuntime/data.txt', 'Scripts/NewHelper.ps1', 'Tools/NewBuildHelper.ps1', 'Tests/test.txt', '.git/config', '.github/workflow.yml', '.gitignore', 'Logs/log.txt', 'Backups/backup.json', 'LastUsedSettings.json', 'Config/LastUsedSettings.json') {
|
||||
Set-Content -LiteralPath (Join-Path $source $path) -Value 'fixture'
|
||||
}
|
||||
$output = Join-Path $source 'output'
|
||||
@@ -59,7 +59,7 @@ Describe 'Release packaging' {
|
||||
foreach ($path in 'extra.txt', 'NewRuntime/data.txt', 'Scripts/NewHelper.ps1', 'Scripts/Get.ps1') {
|
||||
Test-Path -LiteralPath (Join-Path $root $path) | Should -BeTrue
|
||||
}
|
||||
foreach ($path in 'Tests', '.git', '.github', '.gitignore', 'Logs', 'Backups', 'Scripts/Build-Release.ps1', 'Scripts/Run-Tests.ps1', 'LastUsedSettings.json', 'Config/LastUsedSettings.json', 'output') {
|
||||
foreach ($path in 'Tests', 'Tools', '.git', '.github', '.gitignore', 'Logs', 'Backups', 'LastUsedSettings.json', 'Config/LastUsedSettings.json', 'output') {
|
||||
Test-Path -LiteralPath (Join-Path $root $path) | Should -BeFalse
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user