From a838b372de19581dd21484b797e87dcf6466ebb7 Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 17 Oct 2018 01:50:39 +0200 Subject: [PATCH] Fix `brew cask style` with relative paths. --- Library/Homebrew/cask/cmd/style.rb | 2 +- Library/Homebrew/test/cask/cmd/style_spec.rb | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cask/cmd/style.rb b/Library/Homebrew/cask/cmd/style.rb index edee1f3c49..1ea8fc8a4c 100644 --- a/Library/Homebrew/cask/cmd/style.rb +++ b/Library/Homebrew/cask/cmd/style.rb @@ -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 diff --git a/Library/Homebrew/test/cask/cmd/style_spec.rb b/Library/Homebrew/test/cask/cmd/style_spec.rb index bea603b416..8feea7a4d4 100644 --- a/Library/Homebrew/test/cask/cmd/style_spec.rb +++ b/Library/Homebrew/test/cask/cmd/style_spec.rb @@ -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