Переглянути джерело

Add docs:clean task for deleting documentation packages

Thibaut 12 роки тому
батько
коміт
fcaf9879a8
2 змінених файлів з 7 додано та 0 видалено
  1. 1 0
      README.md
  2. 6 0
      lib/tasks/docs.thor

+ 1 - 0
README.md

@@ -102,6 +102,7 @@ thor docs:manifest  # Create the manifest file used by the app
 thor docs:generate  # Generate/scrape a documentation
 thor docs:page      # Generate/scrape a documentation page
 thor docs:package   # Package a documentation for use with docs:download
+thor docs:clean     # Delete documentation packages
 
 # Console
 thor console        # Start a REPL

+ 6 - 0
lib/tasks/docs.thor

@@ -106,6 +106,12 @@ class DocsCLI < Thor
     invalid_doc(error.name)
   end
 
+  desc 'clean', 'Delete documentation packages'
+  def clean
+    File.delete(*Dir[File.join Docs.store_path, '*.tar.gz'])
+    puts 'Done'
+  end
+
   private
 
   def find_docs(names)