mirror of
https://github.com/System-End/highway.git
synced 2026-04-19 16:28:24 +00:00
Add projects:drop task
This commit is contained in:
parent
016e53f601
commit
38a90cbf9f
1 changed files with 15 additions and 0 deletions
|
|
@ -3,4 +3,19 @@ namespace :projects do
|
|||
task clone: :environment do
|
||||
CloneProjectsJob.perform_now
|
||||
end
|
||||
|
||||
desc "Remove all repos in content/projects except for hackclub/awesome-project"
|
||||
task drop: :environment do
|
||||
base_dir = Rails.root.join("content/projects")
|
||||
Dir.glob(base_dir.join("*/*")).each do |dir|
|
||||
next unless File.directory?(dir)
|
||||
# Keep hackclub/awesome-project
|
||||
if dir == base_dir.join("hackclub/awesome-project").to_s
|
||||
next
|
||||
end
|
||||
FileUtils.rm_rf(dir)
|
||||
puts "Removed #{dir}"
|
||||
end
|
||||
puts "Done removing all projects except hackclub/awesome-project."
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue