Skip to content

Commit d68a42d

Browse files
committed
src: utils[artifact_cleaner]
1 parent 17c8cdd commit d68a42d

File tree

1 file changed

+25
-17
lines changed

1 file changed

+25
-17
lines changed

src/utils/artifact_cleaner.cr

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,30 @@
1818
# -----------------------------------------------------------------------
1919

2020
module MoonScript
21-
class ArtifactCleaner
22-
def self.clean(clean_packages: Bool = false)
23-
artifcats = if clean_packages[MOONSCRIPT_PACKAGE_DIR]
24-
else
25-
%w[.ms dist]
26-
end
27-
28-
if artifacts.any?(&->Dir.exists?(String))
29-
artifacts.each do |artifact|
30-
Dir.safe_delete artifcat do
31-
terminals.puts "Deleting: #{artifact}"
32-
end
33-
end
34-
else
35-
terminals.puts "[LOG]: Nothing to delete here..."
36-
end
21+
class ArtifactCleaner
22+
def self.clean(clean_packages : Bool = false)
23+
24+
artifacts =
25+
if clean_packages
26+
[MOONSCRIPT_PACKAGES_DIR]
27+
else
28+
%w[.ms dist]
29+
end
30+
31+
if artifacts.any?(&->Dir.exists?(String))
32+
artifacts.each do |artifact|
33+
Dir.safe_delete artifact do
34+
terminal.puts "[LOG]: Deleting: #{artifact}... 😀"
35+
end
3736
end
37+
else
38+
terminal.puts "[LOG]: Nothing to delete... 😀"
39+
end
40+
end
41+
42+
def self.terminal
43+
Render::Terminal::STDOUT
3844
end
39-
end
45+
46+
end
47+
end

0 commit comments

Comments
 (0)