Merge pull request #5121 from reitermarkus/cask-style

Fix `brew cask style` with relative paths.
This commit is contained in:
commitay 2018-10-17 23:08:34 +10:00 committed by GitHub
commit a89dd3efa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -31,7 +31,7 @@ module Cask
@cask_paths ||= if args.empty? @cask_paths ||= if args.empty?
Tap.map(&:cask_dir).select(&:directory?) Tap.map(&:cask_dir).select(&:directory?)
elsif args.any? { |file| File.exist?(file) } elsif args.any? { |file| File.exist?(file) }
args args.map { |path| Pathname(path).expand_path }
else else
casks.map(&:sourcefile_path) casks.map(&:sourcefile_path)
end end

View File

@ -106,7 +106,10 @@ describe Cask::Cmd::Style, :cask do
end end
it "treats all tokens as paths" do it "treats all tokens as paths" do
expect(subject).to eq(tokens) expect(subject).to eq [
Pathname("adium").expand_path,
Pathname("Casks/dropbox.rb").expand_path,
]
end end
end end