Skip to content

Commit

Permalink
Fix ARGV.next method not found
Browse files Browse the repository at this point in the history
Already partially addressed in timsutton#16, but that
PR missed one call to the non-existent `Array.next`.
  • Loading branch information
overhacked committed Jan 27, 2022
1 parent 157dbe8 commit 3f00d35
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions brew-pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def pkg

abort unpack_usage if ARGV.empty?
identifier_prefix = if ARGV.include? '--identifier-prefix'
ARGV.next.chomp(".")
ARGV[ARGV.index('--identifier-prefix') + 1].chomp(".")
else
'org.homebrew'
end
Expand Down Expand Up @@ -103,7 +103,7 @@ def pkg
# 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")
Expand All @@ -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}"
Expand Down

0 comments on commit 3f00d35

Please sign in to comment.