We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b85e5de commit d9bd5d4Copy full SHA for d9bd5d4
create-exclude-for-controls.rb
@@ -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