Skip to content

Commit

Permalink
Preparing for 1.43 release
Browse files Browse the repository at this point in the history
  • Loading branch information
ttscoff committed Jan 24, 2023
1 parent 58d6c29 commit 064adf2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Brett's PopClip Extensions

My growing collection of [PopClip][popclip] extensions.

_Current release version: **1.42** ([source code](https://github.com/ttscoff/popclipextensions/releases/tag/1.42))_
_Current release version: **1.43** ([source code](https://github.com/ttscoff/popclipextensions/releases/tag/1.43))_

## Installation

Expand Down
24 changes: 24 additions & 0 deletions SearchLink.popclipext/searchlink.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@

input = ENV['POPCLIP_TEXT']

def install_searchlink
unless File.exist?(File.expand_path('~/Library/Services/SearchLink.workflow'))
folder = File.expand_path('~/Downloads')
services = File.expand_path('~/Library/Services')
dl = File.join(folder, 'SearchLink.zip')
`curl -SsL -o "#{dl}" https://github.com/ttscoff/searchlink/releases/latest/download/SearchLink.zip`
Dir.chdir(folder)
`unzip -qo #{dl} -d #{folder}`
FileUtils.rm(dl)

['SearchLink.workflow', 'SearchLink File.workflow', 'Jump to SearchLink Error.workflow'].each do |wflow|
src = File.join(folder, 'SearchLink Services', wflow)
dest = File.join(services, wflow)
if File.exist?(src) && File.exist?(dest)
FileUtils.rm_rf(dest)
end
FileUtils.mv(src, dest, force: true)
end
FileUtils.rm_rf('SearchLink Services')
end
end

install_searchlink

res = `echo #{Shellwords.escape(input)} | automator -i - ~/Library/Services/SearchLink.workflow`.strip

res.gsub!(/'/, "\\\\'")
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.42
1.43

0 comments on commit 064adf2

Please sign in to comment.