From 1fa76d41cd220be4c08b3d697ec6b2cdcd09eef6 Mon Sep 17 00:00:00 2001 From: Gerard Arall Date: Fri, 13 Nov 2020 12:06:42 +0100 Subject: [PATCH] Fix ARGV.next method not found --- brew-pkg.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/brew-pkg.rb b/brew-pkg.rb index 8b7586d..f4b6e58 100755 --- a/brew-pkg.rb +++ b/brew-pkg.rb @@ -100,10 +100,10 @@ def pkg end end - # Add scripts if we specified --scripts + # Add scripts if we specified --scripts found_scripts = false if ARGV.include? '--scripts' - scripts_path = ARGV.next + scripts_path = ARGV[ARGV.index('--scripts') + 1] if File.directory?(scripts_path) pre = File.join(scripts_path,"preinstall") post = File.join(scripts_path,"postinstall") @@ -126,7 +126,7 @@ def pkg # Custom ownership found_ownership = false if ARGV.include? '--ownership' - custom_ownership = ARGV.next + custom_ownership = ARGV[ARGV.index('--ownership') + 1] if ['recommended', 'preserve', 'preserve-other'].include? custom_ownership found_ownership = true ohai "Setting pkgbuild option --ownership with value #{custom_ownership}" @@ -146,11 +146,11 @@ def pkg ] if found_scripts args << "--scripts" - args << scripts_path + args << scripts_path end if found_ownership args << "--ownership" - args << custom_ownership + args << custom_ownership end args << "#{pkgfile}" safe_system "pkgbuild", *args