diff --git a/Library/Homebrew/brew.sh b/Library/Homebrew/brew.sh index bd726940c4..c2f02d4316 100644 --- a/Library/Homebrew/brew.sh +++ b/Library/Homebrew/brew.sh @@ -5,7 +5,7 @@ then fi # USER isn't always set so provide a fall back for `brew` and subprocesses. -export USER=${USER:-`id -un`} +export USER=${USER:-$(id -un)} # Where we store built products; a Cellar in HOMEBREW_PREFIX (often /usr/local # for bottles) unless there's already a Cellar in HOMEBREW_REPOSITORY. diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 9ed95d53e8..d36ebf37a6 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -56,7 +56,7 @@ module Homebrew File.expand_path(file).start_with? HOMEBREW_LIBRARY_PATH end - if files && !has_non_formula + if files.present? && !has_non_formula config = if files.first && File.exist?("#{files.first}/spec") HOMEBREW_LIBRARY/".rubocop_rspec.yml" else @@ -65,7 +65,7 @@ module Homebrew args << "--config" << config end - if files.nil? + if files.blank? args << HOMEBREW_LIBRARY_PATH else args += files @@ -79,7 +79,7 @@ module Homebrew when :print args << "--debug" if Homebrew.args.debug? args << "--display-cop-names" if Homebrew.args.display_cop_names? - args << "--format" << "simple" if files + args << "--format" << "simple" if files.present? system(cache_env, "rubocop", *args) rubocop_success = $CHILD_STATUS.success? when :json @@ -100,7 +100,7 @@ module Homebrew raise "Invalid output_type for check_style_impl: #{output_type}" end - return rubocop_success if files.present? || !has_non_formula + return rubocop_success if files.present? shellcheck = which("shellcheck") shellcheck ||= which("shellcheck", ENV["HOMEBREW_PATH"]) diff --git a/Library/Homebrew/utils/ruby.sh b/Library/Homebrew/utils/ruby.sh index c218a75023..a55b09b028 100644 --- a/Library/Homebrew/utils/ruby.sh +++ b/Library/Homebrew/utils/ruby.sh @@ -44,7 +44,7 @@ If there's no Homebrew Portable Ruby available for your processor: then HOMEBREW_RUBY_PATH="$vendor_ruby_path" [[ -z "$HOMEBREW_MACOS" ]] && TERMINFO_DIRS="$vendor_ruby_terminfo" - if [[ $vendor_ruby_current_version != $vendor_ruby_latest_version ]] + if [[ $vendor_ruby_current_version != "$vendor_ruby_latest_version" ]] then if ! brew vendor-install ruby then diff --git a/bin/brew b/bin/brew index ef4cc6ef49..7d4c6d28ec 100755 --- a/bin/brew +++ b/bin/brew @@ -23,8 +23,8 @@ symlink_target_directory() { builtin enable compgen unset for cmd in $(builtin compgen -A builtin) do - builtin unset -f $cmd - builtin enable $cmd + builtin unset -f "$cmd" + builtin enable "$cmd" done unset cmd