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

Possibility to replace config parameters in CLI with CLI args #54

Open
jack-sf opened this issue Jan 28, 2019 · 4 comments
Open

Possibility to replace config parameters in CLI with CLI args #54

jack-sf opened this issue Jan 28, 2019 · 4 comments

Comments

@jack-sf
Copy link

jack-sf commented Jan 28, 2019

For example, even if my .happo.js includes


  targets: {
    'chrome-desktop': new RemoteBrowserTarget('chrome', {
      viewport: '1200x768',
    }),
    // 'chrome-mobile': new RemoteBrowserTarget('chrome', {
    //   viewport: '320x640',
    // }),
    // 'safari-desktop': new RemoteBrowserTarget('safari', {
    //   viewport: '1200x768',
    // }),
    'safari-mobile': new RemoteBrowserTarget('safari', {
      viewport: '320x640',
    }),
    ie11: new RemoteBrowserTarget('internet explorer', {
      viewport: '1200x768',
    }),
    // Happo currently throws error 500 for ios-safari builds
    // TODO turn it back on when Happo team fixes it
    // iphone: new RemoteBrowserTarget('ios-safari', {
    //   viewport: '375x667',
    // }),
  },

if I could do happo run --targets ie11 or happo dev --targets safari-mobile , I could limit the targets to be enabled on this run only to the specified targets.

(Similarly as --only xxx works in happo dev mode.)

@trotzig
Copy link
Contributor

trotzig commented Jan 28, 2019

This would be a nice addition, thanks for suggesting it!

I can't make any promises to when we'll get to this, so I'd be very happy to accept a PR! I think the easiest way would be to start at src/executeCli.js, add another commander option (--targets?), pass that value to loadUserConfig and have it filter out the right targets.

@trotzig
Copy link
Contributor

trotzig commented Jan 28, 2019

...and sorry about the instability of ios-safari. I'm working on that, I hope to have an update for you soon!

@jack-sf
Copy link
Author

jack-sf commented Jan 28, 2019

Would a --target be a better name?

@trotzig
Copy link
Contributor

trotzig commented Jan 28, 2019

That would work too. I don't feel strongly about it, as long as you're able to specify one or more targets. Either --targets ie,chrome or --target chrome --target ie, I'm okay with both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants