Skip to content

Commit

Permalink
Sort files in scaffold properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign committed Aug 9, 2024
1 parent d9c42a3 commit dd96d5c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 0 additions & 2 deletions spec/spec_helpers.cr
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
def expect_diff(a, b)
a.should eq(b)
rescue error
puts a
puts b
fail diff(a, b)
end

Expand Down
18 changes: 9 additions & 9 deletions spec_cli/init_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ context "init" do
Mint - Initializing a new project
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
⚙ Writing files:
➔ source
➔ Content.mint
➔ Main.mint
➔ assets
➔ bottom-center.png
➔ bottom-left.png
➔ bottom-right.png
➔ favicon.png
➔ head.html
➔ logo.svg
➔ top-center.png
➔ top-right.png
➔ top-left.png
➔ bottom-center.png
➔ logo.svg
➔ favicon.png
➔ bottom-right.png
➔ bottom-left.png
➔ top-right.png
➔ source
➔ Content.mint
➔ Main.mint
➔ tests
➔ Main.mint
➔ mint.json
Expand Down
2 changes: 1 addition & 1 deletion src/references_tracker.cr
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ module Mint

# Calculates which node belongs to which bundle.
def calculate(nodes : Set(Ast::Node)) : Bundles
# Collapse links, removing not needed ones an repointing.
# Collapse links, removing not needed ones and repointing.
collapse

# These will be the bundles, plus the index.
Expand Down
6 changes: 4 additions & 2 deletions src/scaffold.cr
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ module Mint

File.write_p(Path[path, "source", "Main.mint"], main)
else
Assets.files.sort_by(&.path).each do |file|
Assets.files.each do |file|
next unless file.path.starts_with?("/scaffold/")
File.write_p(Path[path, file.path.lchop("/scaffold/")], file)
end
Expand All @@ -61,7 +61,9 @@ module Mint
files = %w[]
dirs = %w[]

Dir.each_child(directory) do |child|
Dir.entries(directory).sort.each do |child|
next if child == "." || child == ".."

path =
Path[directory, child]

Expand Down

0 comments on commit dd96d5c

Please sign in to comment.