Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

define default prefix constants #6508

Merged
merged 1 commit into from Sep 30, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/bottle.rb
Expand Up @@ -16,7 +16,7 @@
<% if !root_url.start_with?(HOMEBREW_BOTTLE_DEFAULT_DOMAIN) %>
root_url "<%= root_url %>"
<% end %>
<% if ![Homebrew::DEFAULT_PREFIX, "/usr/local"].include?(prefix) %>
<% if ![HOMEBREW_DEFAULT_PREFIX, LINUXBREW_DEFAULT_PREFIX].include?(prefix) %>
prefix "<%= prefix %>"
<% end %>
<% if cellar.is_a? Symbol %>
Expand Down
5 changes: 4 additions & 1 deletion Library/Homebrew/global.rb
Expand Up @@ -52,14 +52,17 @@
HOMEBREW_BOTTLE_DEFAULT_DOMAIN = ENV["HOMEBREW_BOTTLE_DEFAULT_DOMAIN"]
HOMEBREW_BOTTLE_DOMAIN = ENV["HOMEBREW_BOTTLE_DOMAIN"]

HOMEBREW_DEFAULT_PREFIX = "/usr/local"
LINUXBREW_DEFAULT_PREFIX = "/home/linuxbrew/.linuxbrew"

require "fileutils"
require "os"
require "os/global"

module Homebrew
extend FileUtils

DEFAULT_PREFIX ||= "/usr/local"
DEFAULT_PREFIX ||= HOMEBREW_DEFAULT_PREFIX
DEFAULT_CELLAR = "#{DEFAULT_PREFIX}/Cellar"
DEFAULT_REPOSITORY = "#{DEFAULT_PREFIX}/Homebrew"

Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/os/linux/global.rb
Expand Up @@ -2,8 +2,8 @@

module Homebrew
DEFAULT_PREFIX ||= if ENV["HOMEBREW_FORCE_HOMEBREW_ON_LINUX"]
"/usr/local"
HOMEBREW_DEFAULT_PREFIX
else
"/home/linuxbrew/.linuxbrew"
LINUXBREW_DEFAULT_PREFIX
end.freeze
end