File tree Expand file tree Collapse file tree 1 file changed +39
-0
lines changed
Expand file tree Collapse file tree 1 file changed +39
-0
lines changed Original file line number Diff line number Diff line change 1+ # -----------------------------------------------------------------------
2+ # This file is part of MoonScript
3+ #
4+ # MoonSript is free software: you can redistribute it and/or modify
5+ # it under the terms of the GNU General Public License as published by
6+ # the Free Software Foundation, either version 3 of the License, or
7+ # (at your option) any later version.
8+ #
9+ # MoonSript is distributed in the hope that it will be useful,
10+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
11+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+ # GNU General Public License for more details.
13+ #
14+ # You should have received a copy of the GNU General Public License
15+ # along with MoonSript. If not, see <https://www.gnu.org/licenses/>.
16+ #
17+ # Copyright (C) 2025 Krisna Pranav, MoonScript Developers
18+ # -----------------------------------------------------------------------
19+
20+ 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
37+ end
38+ end
39+ end
You can’t perform that action at this time.
0 commit comments