sintaxi / surge

CLI for the surge.sh CDN
https://surge.sh
2.87k stars 136 forks source link

Feature Request - Have the CLI remember the "project" value #456

Closed callmeaponte closed 3 years ago

callmeaponte commented 3 years ago

I apologize if this has already been answered or solved, but I tried searching for it (for quite a while) and could not find anything.

Is there a way to "remember" the project that the CLI always prompts you for when you run surge? Similar to how you can create a CNAME file for the CLI to remember the domain.

I'm asking as I'm attempting to automate the deployment, but that prompt is making it difficult since I need to always press enter (even though the default value never changes).

sintaxi commented 3 years ago

Yes. The recommended way to use surge is to avoid using the prompts. Many ways to accomplish this.

The surge command can take two arguments. surge <project-path> <domain>.

So you can run...

surge . example.com

Or you can pass in params...

surge --project . --domain example.com

Or shorthand params...

surge -p . --d example.com

Of course if you need to point to another directory you can...

surge ./path/to/dist example.com

sintaxi commented 3 years ago

Also, its common practice to put this as a script in you package.json file then you can just run...

npm run deploy

callmeaponte commented 3 years ago

Thanks! Good to know.

This is amazing software btw, the simplicity and ease-of-use is a beautiful thing.