handle_exclude_lists.ps1 873 B

1234567891011121314151617181920212223242526272829
  1. # Load and parse the text file with the folders to exclude from the AppData directory
  2. function parse_appdata_exclude($skip=@(), $add=@()) {
  3. $exclude_list = Get-Content (Join-Path $PSScriptRoot exclude_from_appdata.list)
  4. $exclude = @()
  5. foreach ($line in $exclude_list.Split("`n"))
  6. {
  7. if ($line -in $skip) {
  8. continue
  9. } else {
  10. $exclude += '-xr"!' + $line.Trim() + '"'
  11. }
  12. }
  13. foreach ($line in $add)
  14. {
  15. Write-Host "Adding $line"
  16. $exclude += '-xr"!' + $line + '"'
  17. }
  18. return $exclude
  19. }
  20. function parse_sync_exclude() {
  21. $exclude_list = Get-Content (Join-Path $PSScriptRoot exclude_from_sync.list)
  22. $exclude = @()
  23. foreach ($line in $exclude_list.Split("`n"))
  24. {
  25. $exclude += $line.Trim()
  26. }
  27. return ("| " + ($exclude -join ";"))
  28. }