Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ARGV.next method not found #16

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions brew-pkg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
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 All @@ -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
Expand Down