2013-10-03 13 views
0

iOS 프로젝트에서 사용되지 않는 이미지 (* .jpg 및 * .png)를 찾는 작은 bash 스크립트를 만들었습니다. 그리고 여기에 같은 코드가 있습니다.Xcode 프로젝트의 사용되지 않은 이미지

//For removing space and replace '\n' in file and folder names 

`IFS=$'\n'` 

//Find all files with extension *.png and *.jpg 

`for i in `find . -name "*.png" -o -name "*.jpg"``; do` 

//Get the base name of found file 

file=``basename -s .jpg "$i" | xargs basename -s .png`` 

//Replace "\n" with original space so that ack can search exact file name in all files 

filenameWithSpace="${file//$'\n'/ }" 

//Merge both basename and extension for ack command 
//Add this "</dev/null" to ack command for it to work on jenkins setup 

`extension="${i##*.}"` 

`filename="$filenameWithSpace.$extension"` 

result=`ack -i --ignore-file=match:/.\.pbxproj/ "$filename" </dev/null` 

//result=ack -i "$filename" </dev/null 
//If result is NULL then ack did not find any occurrence of the filename in any file 

`if [ -z "$result" ];` 

`then ` 

`echo "$i" ` 

`fi ` 

`done` 

".pbxproj"가 검색에 포함되어야합니까? 나는 ".pbxproj"가 나에게 다른 결과를 제공하는 것을 제외하고이 질문을한다.

미리 감사드립니다.

답변

관련 문제