Skip to content

Instantly share code, notes, and snippets.

@hikarin522
Created May 30, 2018 07:10
Show Gist options
  • Save hikarin522/f9b6f477e03fff8c68644f24d40e2b9e to your computer and use it in GitHub Desktop.
Save hikarin522/f9b6f477e03fff8c68644f24d40e2b9e to your computer and use it in GitHub Desktop.
LFS管理されてないUnityのバイナリ形式ファイルを検索する ref: https://qiita.com/hikarin522/items/21024e5c97cded54a85b
$ .\Get-UnityNonLFS.ps1 '*.asset'
Param([String] $file)
$lfs = git lfs ls-files
Get-ChildItem -Recurse -Filter $file |
?{ ![regex]::IsMatch((Get-Content -Encoding Ascii -TotalCount 1 -ReadCount 1 $_.Target), '^%YAML') } |
%{ Resolve-Path -Relative $_.FullName } |
%{ $_ -replace '^\.\\', '' -replace '\\', '/' } |
?{ ($lfs -match $_).Count -eq 0 } |
?{ (git status --ignored -s -- $_).Count -eq 0 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment