question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add `--config-file` CLI argument

See original GitHub issue

Current behavior:

I cannot specify a configuration file path

Desired behavior:

I want to specify a configuration file path

Test code:

cypress run --config-file "/path/to/config"

Additional Info (images, stack traces, etc)

I’m building a tool for PayPal called paypal-scripts (similar to react-scripts). One of the purposes is to cover 80% of the use cases by hiding all configuration from the user of the tool so they can focus on just writing the code. If they do create a cypress.json file then we’ll use that one, but for most people they should be able to just use the built-in configuration of paypal-scripts and they wont need to have and maintain a cypress.json file at all. There’s honestly not a lot of configuration we’d need (mostly the baseUrl I think), but a lot of the value proposition of paypal-scripts is that people don’t need to worry about configuring anything and it all just works out of the box.

I’m able to do this with eslint, babel, and many other tools, but I can’t currently do it with cypress and I’d like to be able to do that if possible 😃 Thoughts?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:32
  • Comments:23 (10 by maintainers)

github_iconTop GitHub Comments

10reactions
brian-manncommented, Jul 24, 2018

You can use the plugins API to programmatically alter the configuration in whatever way you want today.

You can simply have an empty cypress.json file and then merge in whatever you’d like based on whatever you’d like in whatever manner you want.

https://docs.cypress.io/api/plugins/configuration-api.html

I am confident this can handle whatever you want to throw at it.

9reactions
kentcdoddscommented, Jul 24, 2018

Probably so, but that would require that people have the plugin installed. For my use case I want people to be able to simply run: paypal-scripts e2e and it’ll start things up for them without them having to have any configuration of plugins setup. The less in their filesystem the less they can mess up/have to maintain.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Forget command-line arguments: use a config file | Medium
In this article, I'll show you ready-to-go examples of how moving your hyper-parameter selections, command-line arguments, and default options ...
Read more >
Command line parameters or configuration file? - Stack Overflow
My question is, When and why would you use command line parameters instead of configuration files and vice versa?
Read more >
Command Line Arguments and Config file
Command line arguments are used to start various systems that can run on both the server and client. ... Create a shortcut of...
Read more >
Configuration files · CLI11 Tutorial
You can tell your app to allow configure files with set_config("--config") . There are arguments: the first is the option name. If empty,...
Read more >
Command Line Parameters and Configuration File Keys
Command Line Parameters and Configuration File Keys ; VersionDescription. /vdescr= Specifies the description of the version to be created by import. The default ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found