bunchcli 1.1.10.pre → 1.1.11.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dcda55808cd36cb2a58d47e7d6e0c0fa10772305ab8334bbd40d7f08f38949ae
4
- data.tar.gz: 867e15277ae14bb607337e3bcba90192359bc89747450ec2abd526e441fd825f
3
+ metadata.gz: 70d3422a46d0fcef92ba107d45988048e87861e7c43850804ae8f694fc68073a
4
+ data.tar.gz: d0e9a81d6681c68440171064ee6b43890848ae3a598fe5824ac4d879a57de8e2
5
5
  SHA512:
6
- metadata.gz: 13e69c1cbb174fc1422a6480c96a016067fda4f44fb36a8a711cd3903423ee9b7a441deacd2995ff92f8fbc945c3a3b0dfd0c35e92944cb9bb4eea3713c0bb71
7
- data.tar.gz: a7a76acbe1021ca87bad1fad48c8c06b70095d9db73b2c8368ffe157e49eff9ffc828185fa6c0b750f98fb37face66237df24f57b4ea7f79855e5cf43f8d6613
6
+ metadata.gz: ae5f34bb75d84b59e86ed3646a30f5ef86d90ff7e6cf91fac65a31bbc9d505d8b0944c61e2d4f3445504893639f7591ed0b9dc31a2aa17cf7392a0c7585e9663
7
+ data.tar.gz: 27a8b4693967cc09fd11036caa1162454a393907fff8036f6c8decb4ec47759d758dbc8e59201a797c6978df9d9e066d08e0d085edadfe1cc73adc1b37e0ba39
@@ -153,7 +153,7 @@ EOF
153
153
  launch_if_needed
154
154
  # get front app
155
155
  front_app = %x{osascript -e 'tell application "System Events" to return name of first application process whose frontmost is true'}.strip
156
- bid = bundle_id(front_app)
156
+ bid = bundle_id(front_app) rescue false
157
157
  @success = bid if (bid)
158
158
 
159
159
  if @url_method == 'raw'
@@ -15,9 +15,17 @@ end
15
15
  module Util
16
16
  def bundle_id(app)
17
17
  shortname = app.sub(/\.app$/, '')
18
- apps = `mdfind -onlyin /Applications -onlyin /Applications/Setapp -onlyin /Applications/Utilities -onlyin ~/Applications -onlyin /Developer/Applications 'kMDItemKind==Application'`
18
+ apps = `mdfind -onlyin /Applications -onlyin /Applications/Setapp -onlyin /Applications/Utilities -onlyin ~/Applications -onlyin /Developer/Applications -onlyin /System/Applications 'kMDItemKind==Application'`
19
19
 
20
- foundapp = apps.split(/\n/).select! { |line| line.chomp =~ /#{shortname}\.app$/i }[0]
20
+ return false if !apps || apps.strip.length == 0
21
+
22
+ foundapps = apps.split(/\n/).select! { |line| line.chomp =~ /#{shortname}\.app$/i }
23
+
24
+ if foundapps.length > 0
25
+ foundapp = foundapps[0]
26
+ else
27
+ return false
28
+ end
21
29
 
22
30
  if foundapp
23
31
  bid = `mdls -name kMDItemCFBundleIdentifier -r "#{foundapp}"`.chomp
data/lib/bunch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BunchCLI
2
- VERSION = "1.1.10.pre"
2
+ VERSION = "1.1.11.pre"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bunchcli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.10.pre
4
+ version: 1.1.11.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Terpstra
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-17 00:00:00.000000000 Z
11
+ date: 2021-05-31 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email:
@@ -52,7 +52,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
52
52
  - !ruby/object:Gem::Version
53
53
  version: 1.3.1
54
54
  requirements: []
55
- rubygems_version: 3.2.3
55
+ rubygems_version: 3.2.16
56
56
  signing_key:
57
57
  specification_version: 4
58
58
  summary: A CLI for use with Bunch.app (macOS)