diff --git a/.bin/Scripts/build_kit.ps1 b/.bin/Scripts/build_kit.ps1 index b5c7d7e9..bf38abc8 100644 --- a/.bin/Scripts/build_kit.ps1 +++ b/.bin/Scripts/build_kit.ps1 @@ -155,17 +155,6 @@ catch { Write-Host (" ERROR: Failed to extract files." ) -foregroundcolor "Red" } -## Cleanup ## -Move-Item "$root\Build Kit.cmd" "$bin\Scripts\Build Kit.cmd" -Move-Item "$root\.root_items\*" "$root\" -New-Item "$root\.cbin" 2> $null -Remove-Item "$root\.root_items" -foreach ($item in @(".bin", ".cbin")) { - if (Test-Path "$root\$item") { - (Get-Item "$root\$item").attributes = "Hidden" - } -} - ## Configure ## Write-Host "Configuring kit" wk_pause "Press Enter to open settings..." diff --git a/.gitignore b/.gitignore index 68f9e452..fb551c93 100644 --- a/.gitignore +++ b/.gitignore @@ -35,3 +35,4 @@ .cbin/_Office/ .cbin/_vcredists/ .cbin/wimlib/ +OUT/ diff --git a/Build Kit.cmd b/Build Kit.cmd index 4a81d71b..b16a60cd 100644 --- a/Build Kit.cmd +++ b/Build Kit.cmd @@ -4,16 +4,25 @@ :Init setlocal -call :CheckFlags %* title Wizard Kit: Build Tool +call :CheckFlags %* :LaunchPrep rem Verifies the environment before launching item if not exist ".bin\Scripts\build_kit.ps1" (goto ErrorBuildKitMissing) +:PrepNewKit +rem Copy base files to a new folder OUT\%KIT_NAME_FULL% +robocopy /e . OUT /xd .git .root_items OUT /xf .gitignore "Build Kit.cmd" +robocopy /e .root_items OUT +mkdir OUT\.cbin >nul 2>&1 +attrib +h OUT\.bin >nul 2>&1 +attrib +h OUT\.cbin >nul 2>&1 + :Launch rem Calls the Launch.cmd script using the variables defined above -powershell -executionpolicy bypass -noprofile -file .bin\Scripts\build_kit.ps1 || goto ErrorUnknown +set "file=OUT\.bin\Scripts\build_kit.ps1" +powershell -executionpolicy bypass -noprofile -file %file% || goto ErrorUnknown goto Exit :: Functions ::