File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -45,17 +45,16 @@ def usage
4545
4646Find . find ( '.' ) do |path |
4747 # Change all the paths to the new snake_case name
48- if /foreman_plugin_template/i . match? ( path )
49- new = path . gsub ( 'foreman_plugin_template' , snake )
50- # Recursively copy the directory and store the original for deletion
51- # Check for $ because we don't need to copy template/hosts for example
52- if File . directory? ( path ) && path =~ /foreman_plugin_template$/i
53- FileUtils . cp_r ( path , new )
54- old_dirs << path
55- else
56- # gsub replaces all instances, so it will work on the new directories
57- FileUtils . mv ( path , new )
58- end
48+ next unless /foreman_plugin_template/i . match? ( path )
49+ new = path . gsub ( 'foreman_plugin_template' , snake )
50+ # Recursively copy the directory and store the original for deletion
51+ # Check for $ because we don't need to copy template/hosts for example
52+ if File . directory? ( path ) && path =~ /foreman_plugin_template$/i
53+ FileUtils . cp_r ( path , new )
54+ old_dirs << path
55+ else
56+ # gsub replaces all instances, so it will work on the new directories
57+ FileUtils . mv ( path , new )
5958 end
6059end
6160
You can’t perform that action at this time.
0 commit comments