History

Add 'docs:upload' command

Thibaut Courouble committed 10 years ago

Commit 1f9ef631 parent d5c54c61 file · +13 −0Browse files

Unified · Split

lib/tasks/docs.thor+13−0
@@ -134,6 +134,19 @@ class DocsCLI < Thor · 133 unmodified lines
134 puts 'Done'134 puts 'Done'
135 end135 end
136 136
137 desc 'upload', '[private]'
138 option :dryrun, type: :boolean
139 def upload(*names)
140 docs = find_docs(names)
141 assert_docs(docs)
142 docs.each do |doc|
143 puts "Syncing #{doc.path}..."
144 cmd = "aws s3 sync #{File.join(Docs.store_path, doc.path)} s3://docs.devdocs.io/#{doc.path} --delete"
145 cmd << ' --dryrun' if options[:dryrun]
146 system(cmd)
147 end
148 end
149
137 private150 private
138 151
139 def find_docs(names)152 def find_docs(names)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t