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

Kernel.exec ignores second args if string #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Options defaults to:
:server => 'app.go' # Go source file to run
:test => false # To run go test instead of the app.
:build_only => false # To build instead of run.
:args => [] # Parameters, e.g. :args => 420, :args => [420, 120], :args => ["one", "two"]
:args => [] # Parameters, e.g. :args => 420, :args => [420, 120], :args => ["--one", 420, "--two", 120]
:cmd => 'go' # Name of the Go commandline tool

$ bundle exec guard
3 changes: 2 additions & 1 deletion lib/guard/go/runner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ def run_go_command!

@proc.wait
server_cmd = "./" + @options[:server].sub('.go', '')
@proc = ChildProcess.build server_cmd, options[:args_to_s]
args = [server_cmd, options[:args]].flatten
@proc = ChildProcess.build *args
start_child_process!
end

Expand Down