Skip to content

Commit

Permalink
Cleanup the assets before generating the guides
Browse files Browse the repository at this point in the history
This will fix the issue that digest were being included into
digest paths.
  • Loading branch information
rafaelfranca committed Aug 24, 2024
1 parent c1d04cc commit ec667e5
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions guides/rails_guides/generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def generate
if !dry_run?
# First copy assets and add digests to make sure digest_paths are
# present in generate_guides.
cleanup_assets
process_scss
copy_assets
add_digests
Expand Down Expand Up @@ -128,6 +129,10 @@ def select_only(guides)
end
end

def cleanup_assets
FileUtils.rm_rf(Dir.glob("#{@output_dir}/{stylesheets,javascripts}"))
end

def process_scss
system "bundle exec dartsass \
#{@guides_dir}/assets/stylesrc/style.scss:#{@output_dir}/stylesheets/style.css \
Expand Down

0 comments on commit ec667e5

Please sign in to comment.