File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ def invoke!
6060 invoke_with_conflict_check do
6161 require "fileutils"
6262 FileUtils . mkdir_p ( File . dirname ( destination ) )
63- File . open ( destination , "wb" ) { |f | f . write render }
63+ File . open ( destination , "wb" , config [ :perm ] ) { |f | f . write render }
6464 end
6565 given_destination
6666 end
Original file line number Diff line number Diff line change @@ -33,6 +33,14 @@ def silence!
3333 expect ( File . exist? ( File . join ( destination_root , "doc/config.rb" ) ) ) . to be true
3434 end
3535
36+ it "allows setting file permissions" do
37+ create_file ( "config/private.key" , :perm => 0o600 )
38+ invoke!
39+
40+ stat = File . stat ( File . join ( destination_root , "config/private.key" ) )
41+ expect ( stat . mode . to_s ( 8 ) ) . to eq "100600"
42+ end
43+
3644 it "does not create a file if pretending" do
3745 create_file ( "doc/config.rb" , { } , :pretend => true )
3846 invoke!
You can’t perform that action at this time.
0 commit comments