File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -36,16 +36,26 @@ file 'spec/configuration.yml' => 'spec/configuration.yml.example' do |task|
36
36
CLEAN . exclude task . name
37
37
src_path = File . expand_path ( "../../#{ task . prerequisites . first } " , __FILE__ )
38
38
dst_path = File . expand_path ( "../../#{ task . name } " , __FILE__ )
39
- cp src_path , dst_path
40
- sh "sed -i 's/LOCALUSERNAME/#{ ENV [ 'USER' ] } /' #{ dst_path } "
39
+
40
+ dst_file = File . open ( dst_path , 'w' )
41
+ File . open ( src_path ) do |f |
42
+ f . each_line do |line |
43
+ dst_file . write line . gsub ( /LOCALUSERNAME/ , ENV [ 'USER' ] )
44
+ end
45
+ end
41
46
end
42
47
43
48
file 'spec/my.cnf' => 'spec/my.cnf.example' do |task |
44
49
CLEAN . exclude task . name
45
50
src_path = File . expand_path ( "../../#{ task . prerequisites . first } " , __FILE__ )
46
51
dst_path = File . expand_path ( "../../#{ task . name } " , __FILE__ )
47
- cp src_path , dst_path
48
- sh "sed -i 's/LOCALUSERNAME/#{ ENV [ 'USER' ] } /' #{ dst_path } "
52
+
53
+ dst_file = File . open ( dst_path , 'w' )
54
+ File . open ( src_path ) do |f |
55
+ f . each_line do |line |
56
+ dst_file . write line . gsub ( /LOCALUSERNAME/ , ENV [ 'USER' ] )
57
+ end
58
+ end
49
59
end
50
60
51
61
Rake ::Task [ :spec ] . prerequisites << :'spec/configuration.yml'
You can’t perform that action at this time.
0 commit comments