Skip to content

Commit

Permalink
Account for TOCTOU bug
Browse files Browse the repository at this point in the history
It's possible that `postcss.config.js` could be deleted, even if we
check for its existence.

Co-authored-by: Mike Burns <[email protected]>
  • Loading branch information
stevepolitodesign and mike-burns committed May 9, 2024
1 parent 47199bf commit 1b1795a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/generators/suspenders/styles_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ def install_postcss_url
end

def configures_postcss
File.delete(postcss_config) if File.exist?(postcss_config)
begin
File.delete(postcss_config)
rescue Errno::ENOENT
end

empty_directory "app/assets/static"
create_file "app/assets/static/.gitkeep"
Expand Down

0 comments on commit 1b1795a

Please sign in to comment.