davideisinger.com

My personal website
Log | Files | Refs | README

commit b3dbf3c743af3e702fdecb402a836ef1a1a7ee49
parent 14e183cb0f2e929cd6c409401b2f235242e4ec4b
Author: David Eisinger <[email protected]>
Date:   Fri,  8 Mar 2024 11:01:18 -0500

copy archive yaml to clipboard

Diffstat:
Mbin/archive | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

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