-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
BGMP
committed
Jan 13, 2022
1 parent
bcb77e6
commit 7181bc3
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# JetBrains | ||
.idea | ||
|
||
# Vim generated files | ||
*~ | ||
*.swp | ||
|
||
# Ignore all logfiles and tempfiles. | ||
/log/* | ||
/tmp/* | ||
!/log/.keep | ||
!/tmp/.keep | ||
|
||
# Re-Volt Paintkits | ||
*.psd | ||
*.pdn | ||
*.xcf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
source 'https://rubygems.org' | ||
|
||
ruby '2.7.3' | ||
|
||
gem 'rake', '~> 13.0', '>= 13.0.6' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
GEM | ||
remote: https://rubygems.org/ | ||
specs: | ||
rake (13.0.6) | ||
|
||
PLATFORMS | ||
x64-mingw32 | ||
|
||
DEPENDENCIES | ||
rake (~> 13.0, >= 13.0.6) | ||
|
||
BUNDLED WITH | ||
2.2.26 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
task :default => [:clean] | ||
|
||
task :clean do | ||
deleted_bytes = 0.0.to_f | ||
|
||
# Remove unnecessary directories | ||
delete_dir = %w[extra paintkit additional] | ||
Dir[File.join('cars', '**', '*')].select { |p| File.directory? p }.each do |d| | ||
next unless delete_dir.include? File.basename(d) | ||
|
||
puts "Removing #{d}/" | ||
subdirs = Dir[File.join(d, '**', '*')].reject { |p| File.directory? p } | ||
i = 0 | ||
subdirs.each do |f| | ||
branch = if subdirs.size == i + 1 | ||
' └──' | ||
else | ||
' ├──' | ||
end | ||
|
||
deleted_bytes += File.size(f).to_f | ||
puts("#{branch} #{f} (#{'%.2f' % (File.size(f).to_f / 2**20)} MB) ...") | ||
i += 1 | ||
end | ||
|
||
FileUtils.remove_dir(d) if File.exist?(d) | ||
end | ||
|
||
# Remove unnecessary files | ||
delete_ext = %w[.psd .pdn .xcf] | ||
Dir[File.join('cars', '**', '*')].reject { |p| File.directory? p }.each do |f| | ||
next unless delete_ext.include? File.extname(f) | ||
|
||
deleted_bytes += File.size(f).to_f | ||
puts("Removing #{f} (#{'%.2f' % (File.size(f).to_f / 2**20)} MB) ...") | ||
File.delete(f) if File.exist?(f) | ||
end | ||
|
||
if deleted_bytes == 0.0 | ||
puts 'Nothing to remove.' | ||
else | ||
puts "Total removed: #{'%.2f' % (deleted_bytes / 2**20)} MB." | ||
end | ||
|
||
puts 'OK.' | ||
end |