File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def check_woff2
5050
5151 # Calculates a hash of vectors, options, and templates (content and filenames)
5252 def checksum
53- files = Dir . glob ( File . join ( @options [ :input ] [ :vectors ] , "*.svg" ) ) . select { |fn | File . file? ( fn ) }
53+ files = Dir . glob ( File . join ( @options [ :input ] [ :vectors ] , "**/* .svg" ) ) . select { |fn | File . file? ( fn ) }
5454 files += Dir . glob ( File . join ( @options [ :input ] [ :templates ] , "*" ) ) . select { |fn | File . file? ( fn ) }
5555 content = files . map { |file | File . read ( file ) } . join
5656 content << files . join
Original file line number Diff line number Diff line change @@ -47,10 +47,10 @@ def set_glyph_info
4747 0xf100
4848 end
4949
50- files = Dir . glob File . join ( @options [ :input ] [ :vectors ] , "*.svg" )
50+ files = Dir . glob File . join ( @options [ :input ] [ :vectors ] , "**/* .svg" )
5151 glyphs = { }
5252 files . each do |file |
53- name = File . basename file , ". svg"
53+ name = file . sub ( /^ #{ @options [ :input ] [ :vectors ] } \/ ?/ , '' ) . sub ( / \. svg$/ , '' )
5454 name = name . strip . gsub ( /\W / , "-" )
5555 glyphs [ name . to_sym ] = { :source => file }
5656 if File . read ( file ) . include? "rgba"
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ def set_input_paths
119119 @options [ :input ] = { :vectors => input , :templates => input }
120120 end
121121
122- if Dir [ File . join ( @options [ :input ] [ :vectors ] , "*.svg" ) ] . empty?
122+ if Dir . glob ( File . join ( @options [ :input ] [ :vectors ] , "**/* .svg" ) ) . empty?
123123 raise Fontcustom ::Error , "`#{ @options [ :input ] [ :vectors ] } ` doesn't contain any SVGs."
124124 end
125125 end
You can’t perform that action at this time.
0 commit comments