Skip to content

Commit 436a98a

Browse files
committed
Ensure documentation files are present before uploading in thor docs:upload command
1 parent 7828802 commit 436a98a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

lib/tasks/docs.thor

+13
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,19 @@ class DocsCLI < Thor
174174

175175
assert_docs(docs)
176176

177+
# Verify files are present
178+
docs.each do |doc|
179+
unless Dir.exists?(File.join(Docs.store_path, doc.path))
180+
puts "ERROR: directory #{File.join(Docs.store_path, doc.path)} not found."
181+
return
182+
end
183+
184+
unless File.exists?(File.join(Docs.store_path, "#{doc.path}.tar.gz"))
185+
puts "ERROR: package for '#{doc.slug}' documentation not found. Run 'thor docs:package #{doc.slug}' to create it."
186+
return
187+
end
188+
end
189+
177190
# Sync files with S3 (used by the web app)
178191
puts '[S3] Begin syncing.'
179192
docs.each do |doc|

0 commit comments

Comments
 (0)