Skip to content

Commit

Permalink
Merge pull request #1021 from chris-araman/mas-account
Browse files Browse the repository at this point in the history
Remove `mas account` check
  • Loading branch information
MikeMcQuaid authored Nov 5, 2021
2 parents 6ea4618 + 3d3f5d3 commit e11704f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 16 deletions.
4 changes: 4 additions & 0 deletions lib/bundle/bundle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def whalebrew_installed?
end

def mas_signedin?
# mas account doesn't work on Monterey (yet)
# https://github.com/mas-cli/mas/issues/417#issuecomment-957963271
return true if MacOS.version >= :monterey

Kernel.system "mas account &>/dev/null"
end

Expand Down
5 changes: 0 additions & 5 deletions lib/bundle/mac_app_store_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ def preinstall(name, id, no_upgrade: false, verbose: false)
return false
end

if MacOS.version == :monterey
puts "Skipping install of #{name} app. mas is not yet functional on Monterey" if verbose
return false
end

unless Bundle.mas_signedin?
puts "Not signed in to Mac App Store." if verbose
raise "Unable to install #{name} app. mas not signed in to Mac App Store."
Expand Down
12 changes: 1 addition & 11 deletions spec/bundle/mac_app_store_installer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
it "outputs an error" do
allow(described_class).to receive(:installed_app_ids).and_return([123])
allow(described_class).to receive(:outdated_app_ids).and_return([123])
allow(MacOS).to receive(:version).and_return(:big_sur)
expect(Kernel).to receive(:system).with("mas account &>/dev/null").and_return(false)
expect { described_class.preinstall("foo", 123) }.to raise_error(RuntimeError)
end
Expand All @@ -76,17 +77,6 @@
end
end

context "when on Monterey" do
before do
allow(MacOS).to receive(:version).and_return(:monterey)
end

it "skips" do
expect(Bundle).not_to receive(:system)
expect(described_class.preinstall("foo", 123)).to be(false)
end
end

context "when app is outdated" do
before do
allow(described_class).to receive(:installed_app_ids).and_return([123])
Expand Down

0 comments on commit e11704f

Please sign in to comment.