DRY up formula prefix

This commit is contained in:
Lukas Oberhuber 2022-08-02 08:50:37 -07:00
parent 88a69b3de2
commit 60831da3b8

View File

@ -46,13 +46,14 @@ class Mktemp
end end
def run def run
prefix_name = @prefix.tr "@", "AT"
if @retain_in_cache if @retain_in_cache
source_dir = "#{HOMEBREW_CACHE}/Sources/#{@prefix.tr "@", "AT"}" source_dir = "#{HOMEBREW_CACHE}/Sources/#{prefix_name}"
chmod_rm_rf(source_dir) # clear out previous (otherwise not sure what happens) chmod_rm_rf(source_dir) # clear out previous (otherwise not sure what happens)
FileUtils.mkdir_p(source_dir) FileUtils.mkdir_p(source_dir)
@tmpdir = Pathname.new(source_dir) @tmpdir = Pathname.new(source_dir)
else else
@tmpdir = Pathname.new(Dir.mktmpdir("#{@prefix.tr "@", "AT"}-", HOMEBREW_TEMP)) @tmpdir = Pathname.new(Dir.mktmpdir("#{prefix_name}-", HOMEBREW_TEMP))
end end
# Make sure files inside the temporary directory have the same group as the # Make sure files inside the temporary directory have the same group as the