Skip to content

Commit dd96d5c

Browse files
committed
Sort files in scaffold properly.
1 parent d9c42a3 commit dd96d5c

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

spec/spec_helpers.cr

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
def expect_diff(a, b)
22
a.should eq(b)
33
rescue error
4-
puts a
5-
puts b
64
fail diff(a, b)
75
end
86

spec_cli/init_spec.cr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,19 @@ context "init" do
2929
Mint - Initializing a new project
3030
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
3131
⚙ Writing files:
32-
➔ source
33-
➔ Content.mint
34-
➔ Main.mint
3532
➔ assets
33+
➔ bottom-center.png
34+
➔ bottom-left.png
35+
➔ bottom-right.png
36+
➔ favicon.png
3637
➔ head.html
38+
➔ logo.svg
3739
➔ top-center.png
38-
➔ top-right.png
3940
➔ top-left.png
40-
➔ bottom-center.png
41-
➔ logo.svg
42-
➔ favicon.png
43-
➔ bottom-right.png
44-
➔ bottom-left.png
41+
➔ top-right.png
42+
➔ source
43+
➔ Content.mint
44+
➔ Main.mint
4545
➔ tests
4646
➔ Main.mint
4747
➔ mint.json

src/references_tracker.cr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ module Mint
8484

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

9090
# These will be the bundles, plus the index.

src/scaffold.cr

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ module Mint
3838

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

64-
Dir.each_child(directory) do |child|
64+
Dir.entries(directory).sort.each do |child|
65+
next if child == "." || child == ".."
66+
6567
path =
6668
Path[directory, child]
6769

0 commit comments

Comments
 (0)