Deprecate --caskroom flag.

This commit is contained in:
Markus Reiter 2017-05-23 17:37:37 +02:00
parent a3e30a11d1
commit 0bb2773b17
6 changed files with 15 additions and 17 deletions

View File

@ -49,7 +49,6 @@ module Hbc
include Options include Options
option "--caskroom=PATH", ->(value) { Hbc.caskroom = value }
option "--appdir=PATH", ->(value) { Hbc.appdir = value } option "--appdir=PATH", ->(value) { Hbc.appdir = value }
option "--colorpickerdir=PATH", ->(value) { Hbc.colorpickerdir = value } option "--colorpickerdir=PATH", ->(value) { Hbc.colorpickerdir = value }
option "--prefpanedir=PATH", ->(value) { Hbc.prefpanedir = value } option "--prefpanedir=PATH", ->(value) { Hbc.prefpanedir = value }

View File

@ -2,6 +2,7 @@ require "compat/hbc/cask_loader"
require "compat/hbc/cli/update" require "compat/hbc/cli/update"
require "compat/hbc/cache" require "compat/hbc/cache"
require "compat/hbc/caskroom" require "compat/hbc/caskroom"
require "compat/hbc/cli"
module Hbc module Hbc
class << self class << self

View File

@ -0,0 +1,12 @@
require "cask/lib/hbc/cli/options"
module Hbc
class CLI
include Options
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

View File

@ -160,9 +160,6 @@ in a future version.
* `--require-sha`: * `--require-sha`:
Abort Cask installation if the Cask does not have a checksum defined. 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`: * `--verbose`:
Give additional feedback during installation. Give additional feedback during installation.
@ -255,7 +252,7 @@ Environment variables specific to Homebrew-Cask:
the command-line. This is particularly useful to make options persistent. the command-line. This is particularly useful to make options persistent.
For example, you might add to your .bash_profile or .zshenv something like: 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: Other environment variables:

View File

@ -54,13 +54,6 @@ describe Hbc::CLI, :cask do
described_class.run("noop") described_class.run("noop")
end 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 it "exits with a status of 1 when something goes wrong" do
allow(described_class).to receive(:lookup_command).and_raise(Hbc::CaskError) allow(described_class).to receive(:lookup_command).and_raise(Hbc::CaskError)
command = Hbc::CLI.new("noop") command = Hbc::CLI.new("noop")

View File

@ -161,10 +161,6 @@ Skip Cask dependencies when installing\.
Abort Cask installation if the Cask does not have a checksum defined\. Abort Cask installation if the Cask does not have a checksum defined\.
. .
.TP .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 \fB\-\-verbose\fR
Give additional feedback during installation\. Give additional feedback during installation\.
. .
@ -290,7 +286,7 @@ This variable may contain any arguments normally used as options on the command\
. .
.nf .nf
export HOMEBREW_CASK_OPTS=\'\-\-appdir=/Applications \-\-caskroom=/etc/Caskroom\' export HOMEBREW_CASK_OPTS=\'\-\-appdir=~/Applications \-\-fontdir=/Library/Fonts\'
. .
.fi .fi
. .