Skip to content

Commit d9bd5d4

Browse files
committed
add ruby for generating exclude file
1 parent b85e5de commit d9bd5d4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

create-exclude-for-controls.rb

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
exclude_file = "_excludefile.yml"
2+
config_file = "_config.yml"
3+
4+
paths_to_include = ARGV.collect!{|arg| arg += '/' unless arg[-1] == '/'}
5+
6+
orig_config = File.read(config_file)
7+
orig_exlude = orig_config[/(?<=exclude: \[)[^\]]*/].split(',')
8+
all_paths = Dir["*/"].reject{ |f| f["images"] || f[0] == '_' || orig_exlude.include?(f) || paths_to_include.include?(f) || f == "controls/"}
9+
all_controls_paths = Dir["controls/*/"].reject{ |f| f["images"] || f[0] == '_' || orig_exlude.include?(f) || paths_to_include.include?(f)}
10+
11+
exclude = orig_exlude + all_paths + all_controls_paths
12+
exclude_text = "exclude: [" + exclude.join(',') + "]"
13+
14+
File.write(exclude_file, exclude_text)

0 commit comments

Comments
 (0)