Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate --caskroom flag. #2672

Merged
merged 2 commits into from
May 24, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions Library/Homebrew/cask/lib/hbc/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ class CLI

include Options

option "--caskroom=PATH", ->(value) { Hbc.caskroom = value }
option "--appdir=PATH", ->(value) { Hbc.appdir = value }
option "--colorpickerdir=PATH", ->(value) { Hbc.colorpickerdir = value }
option "--prefpanedir=PATH", ->(value) { Hbc.prefpanedir = value }
Expand All @@ -63,10 +62,6 @@ class CLI
option "--vst_plugindir=PATH", ->(value) { Hbc.vst_plugindir = value }
option "--vst3_plugindir=PATH", ->(value) { Hbc.vst3_plugindir = value }
option "--screen_saverdir=PATH", ->(value) { Hbc.screen_saverdir = value }
option "--binarydir=PATH", ->(*) { opoo(<<-EOS.undent) }
Option --binarydir is obsolete!
Homebrew-Cask now uses the same location as your Homebrew installation for executable links.
EOS

option "--help", :help, false

Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/compat/hbc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
require "compat/hbc/cli/update"
require "compat/hbc/cache"
require "compat/hbc/caskroom"
require "compat/hbc/cli"

module Hbc
class << self
Expand Down
19 changes: 19 additions & 0 deletions Library/Homebrew/compat/hbc/cli.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
require "cask/lib/hbc/cli/options"

module Hbc
class CLI
include Options

option "--binarydir=PATH", (lambda do |*|
opoo <<-EOS.undent
Option --binarydir is obsolete!
Homebrew-Cask now uses the same location as your Homebrew installation for executable links.
EOS
end)

option "--caskroom=PATH", (lambda do |value|
Hbc.caskroom = value
odeprecated "`brew cask` with the `--caskroom` flag", disable_on: Time.utc(2017, 10, 31)
end)
end
end
5 changes: 1 addition & 4 deletions Library/Homebrew/manpages/brew-cask.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,6 @@ in a future version.
* `--require-sha`:
Abort Cask installation if the Cask does not have a checksum defined.

* `--caskroom=<path>`:
Set location of the Caskroom, where all binaries are stored. The default value is `$(brew --prefix)/Caskroom`.

* `--verbose`:
Give additional feedback during installation.

Expand Down Expand Up @@ -255,7 +252,7 @@ Environment variables specific to Homebrew-Cask:
the command-line. This is particularly useful to make options persistent.
For example, you might add to your .bash_profile or .zshenv something like:

export HOMEBREW_CASK_OPTS='--appdir=/Applications --caskroom=/etc/Caskroom'
export HOMEBREW_CASK_OPTS='--appdir=~/Applications --fontdir=/Library/Fonts'

Other environment variables:

Expand Down
7 changes: 0 additions & 7 deletions Library/Homebrew/test/cask/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@
described_class.run("noop")
end

it "respects the env variable when choosing a non-default Caskroom location" do
allow(ENV).to receive(:[])
allow(ENV).to receive(:[]).with("HOMEBREW_CASK_OPTS").and_return("--caskroom=/custom/caskdir")
expect(Hbc).to receive(:caskroom=).with(Pathname.new("/custom/caskdir"))
described_class.run("noop")
end

it "exits with a status of 1 when something goes wrong" do
allow(described_class).to receive(:lookup_command).and_raise(Hbc::CaskError)
command = Hbc::CLI.new("noop")
Expand Down
6 changes: 1 addition & 5 deletions manpages/brew-cask.1
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,6 @@ Skip Cask dependencies when installing\.
Abort Cask installation if the Cask does not have a checksum defined\.
.
.TP
\fB\-\-caskroom=<path>\fR
Set location of the Caskroom, where all binaries are stored\. The default value is \fB$(brew \-\-prefix)/Caskroom\fR\.
.
.TP
\fB\-\-verbose\fR
Give additional feedback during installation\.
.
Expand Down Expand Up @@ -290,7 +286,7 @@ This variable may contain any arguments normally used as options on the command\
.
.nf

export HOMEBREW_CASK_OPTS=\'\-\-appdir=/Applications \-\-caskroom=/etc/Caskroom\'
export HOMEBREW_CASK_OPTS=\'\-\-appdir=~/Applications \-\-fontdir=/Library/Fonts\'
.
.fi
.
Expand Down