copy archive yaml to clipboard
This commit is contained in:
@@ -6,6 +6,7 @@ require "digest"
|
|||||||
require "time"
|
require "time"
|
||||||
|
|
||||||
*urls = ARGV
|
*urls = ARGV
|
||||||
|
clipboard = ""
|
||||||
|
|
||||||
unless urls.any?
|
unless urls.any?
|
||||||
warn "Please supply one or more URLs"
|
warn "Please supply one or more URLs"
|
||||||
@@ -41,10 +42,16 @@ urls.each do |url|
|
|||||||
|
|
||||||
File.write("static/archive/#{filename}", text_content)
|
File.write("static/archive/#{filename}", text_content)
|
||||||
|
|
||||||
puts <<~STR
|
yaml = <<~STR
|
||||||
- title: "#{title}"
|
- title: "#{title}"
|
||||||
url: #{url}
|
url: #{url}
|
||||||
date: #{Time.now.utc.iso8601}
|
date: #{Time.now.utc.iso8601}
|
||||||
file: #{filename}
|
file: #{filename}
|
||||||
STR
|
STR
|
||||||
|
|
||||||
|
puts yaml
|
||||||
|
|
||||||
|
clipboard += yaml
|
||||||
end
|
end
|
||||||
|
|
||||||
|
IO.popen("pbcopy", "w") { |pb| pb.write(clipboard) }
|
||||||
|
|||||||
Reference in New Issue
Block a user