Fix brew cask style with relative paths.

This commit is contained in:
Markus Reiter 2018-10-17 01:50:39 +02:00
parent 178db5dca5
commit a838b372de
2 changed files with 5 additions and 2 deletions

View File

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

View File

@ -106,7 +106,10 @@ describe Cask::Cmd::Style, :cask do
end
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