Skip to content
This repository was archived by the owner on Feb 13, 2020. It is now read-only.

Fix passing options to Sauce Connect#344

Open
Ostrzy wants to merge 2 commits into
sauce-archives:masterfrom
monterail:master
Open

Fix passing options to Sauce Connect#344
Ostrzy wants to merge 2 commits into
sauce-archives:masterfrom
monterail:master

Conversation

@Ostrzy
Copy link
Copy Markdown

@Ostrzy Ostrzy commented Jul 6, 2015

Currently when some options are passed to Sauce Connect using

Sauce.config do |config|
  config[:connect_options] = { tunnel_identifier: "Tunnel Name" }
end

it is simply ignored because only first option (which is always readyfile) is return in the first block execution of collect.
Additionally I've added some basic escaping for passed parameters using ' - in my case tunnel name was LOCAL(username) and it was simply failing when passed directly to shell as an option.
I wanted to create some spec for that, but didn't have any good idea how to test it.

@DylanLacey
Copy link
Copy Markdown
Contributor

Hey, thanks for the commit! Weird, I thought I fixed the collect issue with a previous commit. I'll have to go digging.

What shell are you using? I'm not entirely sure whether shell escaping is standard or not, that'd be my only concern.

Oh, and... There are no tests. Yet. >.>

@Ostrzy
Copy link
Copy Markdown
Author

Ostrzy commented Jul 7, 2015

I am using zsh, but when I'm trying to pass LOCAL(username) as an option in bash I also get an error. In both cases applying ' solves problem. I can remove this, but then for some identifiers containing forbidden characters or spaces there will be some escaping needed:

Sauce.config do |config|
  tunnel_name = "LOCAL(#{ENV['SAUCE_USERNAME']})"
  config[:connect_options] = { tunnel_identifier: "'#{tunnel_name}'" }
  config["tunnel-identifier"] = tunnel_name
end

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants