Created
September 21, 2018 01:40
-
-
Save dongyuwei/0261a6f0bead1d66ebd1ab5b913cde21 to your computer and use it in GitHub Desktop.
find the svg which fontcustom failed to compile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
files = `ls ./svg_icons/*.svg` | |
bad_files = [] | |
files.split("\n").each {|f| | |
`rm -rf ./tmp ./tmp2` | |
`mkdir ./tmp` | |
`cp #{f} ./tmp` | |
ok = system("fontcustom compile ./tmp/ -o tmp2") | |
if $?.exitstatus != 0 | |
puts "bad file: #{f}" | |
bad_files.push f | |
end | |
} | |
puts "bad_files", bad_files |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
遇到不合预期(编译报错或者有背景黑色等常见问题)时,二分法注释掉svg部分代码可以很快定位问题,排除法 是比较有效的方法。