diff options
| author | Kaito Udagawa | 2016-11-19 13:05:55 +0900 |
|---|---|---|
| committer | Kaito Udagawa | 2016-11-19 14:52:38 +0900 |
| commit | 28072021031836937a01e9fd995b03995fe49443 (patch) | |
| tree | 316860378cfa0c5a5f5936d4b1f592d458a22d8a /Library/Homebrew/cask/lib | |
| parent | f4a3bc100b4b98a3d06222c15934abb36bf16594 (diff) | |
| download | brew-28072021031836937a01e9fd995b03995fe49443.tar.bz2 | |
cask: use Tempfile and some style fixes
Diffstat (limited to 'Library/Homebrew/cask/lib')
| -rw-r--r-- | Library/Homebrew/cask/lib/hbc/artifact/pkg.rb | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/artifact/pkg.rb b/Library/Homebrew/cask/lib/hbc/artifact/pkg.rb index 2f34814ab..cede9f4d5 100644 --- a/Library/Homebrew/cask/lib/hbc/artifact/pkg.rb +++ b/Library/Homebrew/cask/lib/hbc/artifact/pkg.rb @@ -55,19 +55,16 @@ module Hbc args << "-verboseR" if Hbc.verbose args << "-allowUntrusted" if pkg_install_opts :allow_untrusted if pkg_install_opts :choices - args << "-applyChoiceChangesXML" - args << choices_xml + choices_file = choices_xml + args << "-applyChoiceChangesXML" << choices_file.path end @command.run!("/usr/sbin/installer", sudo: true, args: args, print_stdout: true) end def choices_xml - path = @cask.staged_path.join("Choices.xml") - unless File.exist? path - choices = pkg_install_opts :choices - IO.write path, Plist::Emit.dump(choices) - end - path + file = Tempfile.open(["", ".xml"]) + file.write Plist::Emit.dump(pkg_install_opts(:choices)) + file end end end |
