-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fallback to a temp dir when the home directory is not usable #4951
Changes from all commits
002939b
02e7f67
8246923
3071a0b
2ac0c51
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ def rubygem_push(path) | |
allowed_push_host = @gemspec.metadata["allowed_push_host"] | ||
gem_command += " --host #{allowed_push_host}" if allowed_push_host | ||
end | ||
unless allowed_push_host || Pathname.new("~/.gem/credentials").expand_path.file? | ||
unless allowed_push_host || Bundler.user_home.join(".gem/credentials").file? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, as I suspected. That means we don't want to use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why don't we want to use a temp directory for writing a settings file? It would allow users without a home directory to have 'global' settings for at least a single usage session |
||
raise "Your rubygems.org credentials aren't set. Run `gem push` to set them." | ||
end | ||
sh(gem_command) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,6 +83,10 @@ def silence(&blk) | |
with_level("silent", &blk) | ||
end | ||
|
||
def unprinted_warnings | ||
[] | ||
end | ||
|
||
private | ||
|
||
# valimism | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,10 @@ | |
module Bundler | ||
module UI | ||
class Silent | ||
def initialize | ||
@warnings = [] | ||
end | ||
|
||
def add_color(string, color) | ||
string | ||
end | ||
|
@@ -13,6 +17,7 @@ def confirm(message, newline = nil) | |
end | ||
|
||
def warn(message, newline = nil) | ||
@warnings |= [message] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I accidentally removed @indirect's comment. Original comment was saying that (recovering from memories):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. until the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do you feel about making this a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do you feel about using a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's fine, I think I was just copying what the |
||
end | ||
|
||
def error(message, newline = nil) | ||
|
@@ -44,6 +49,10 @@ def trace(message, newline = nil) | |
def silence | ||
yield | ||
end | ||
|
||
def unprinted_warnings | ||
@warnings | ||
end | ||
end | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
user_name
isPathname
already. So it should be safe to leaveuser_home.join(".bundle")