Skip to content

Instantly share code, notes, and snippets.

@dongyuwei
Created September 21, 2018 01:40
Show Gist options
  • Save dongyuwei/0261a6f0bead1d66ebd1ab5b913cde21 to your computer and use it in GitHub Desktop.
Save dongyuwei/0261a6f0bead1d66ebd1ab5b913cde21 to your computer and use it in GitHub Desktop.
find the svg which fontcustom failed to compile
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
@dongyuwei
Copy link
Author

dongyuwei commented Oct 24, 2018

遇到不合预期(编译报错或者有背景黑色等常见问题)时,二分法注释掉svg部分代码可以很快定位问题,排除法 是比较有效的方法。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment