Skip to content

Commit

Permalink
feat: switch to getter!
Browse files Browse the repository at this point in the history
  • Loading branch information
mdwagner committed Jul 16, 2023
1 parent dd924c7 commit 2fad329
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions src/lucky_template.cr
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,7 @@ module LuckyTemplate
::File.open(path, "w") do |io|
file.to_s(io)
end
if perms = file.perms
::File.chmod(path, perms)
end
::File.chmod(path, file.perms) if file.perms?
in Folder
Dir.mkdir_p(path)
write_folder!(path, file)
Expand Down
2 changes: 1 addition & 1 deletion src/lucky_template/file.cr
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ module LuckyTemplate

# :nodoc:
class File
property perms : Int16?
getter! perms : Int16

protected def initialize(@file : FileType, @perms)
end
Expand Down

0 comments on commit 2fad329

Please sign in to comment.