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.

[REQ] Pre generation scripts

See original GitHub issue

Is your feature request related to a problem? Please describe.

Current php-lumen server generator contains 30 files where 2 files are dynamic and 28 files are static. We can wipe off 28 files because following command from Lumen documentation generates them for us:

$  composer create-project --prefer-dist laravel/lumen lib
Creating a "laravel/lumen" project at "./lib"

                                                                                                                   
  [InvalidArgumentException]                                                                                       
  Project directory "/Users/ybelenko/Sites/openapi-generator/samples/server/petstore/php-lumen/lib" is not empty.  

But, this script refuses to generate project in non-empty directory.

Describe the solution you’d like

Somehow I need to clean output directory(maybe with a warning of data loss) then run composer create-project and only after that run generation to overwrite dynamic files. It feels like I need PRE PROCESS script or something like that.

Describe alternatives you’ve considered

Keep storing 28 static files like we did before.

Or we can describe in readme that user needs to generate files, then move them in different folder, run create project script then move files back. In this scenario I guess that samples build will not pass CI because of missed files.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
jimschubertcommented, Jul 11, 2020

Yeah I think that will work. They don’t seem to have an official license header or even a LICENSE file to copy a longer license from.

0reactions
ybelenkocommented, Jul 11, 2020

@jimschubert something like?

/**
 * The Lumen framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
 */

I copied that line from https://github.com/laravel/lumen#license

Read more comments on GitHub >

github_iconTop Results From Across the Web

Writing pre-request scripts - Postman Learning Center
You can use pre-request scripts in Postman to execute JavaScript before a request runs. By including code in the Pre-request Script tab for...
Read more >
How & When To Use Postman Pre Request And Post Request ...
Pre -request scripts are logic or piece of code that are guaranteed to execute before the request execution begins. It allows for adding...
Read more >
Pre and post request scripts | Altair GraphQL Client
Pre request scripts enables you do that. With pre request scripts, you can set environment variables from your cookies or create any combination...
Read more >
Using Pre Request Script in Postman | Codementor
Enter pre request scripts. Postman allows you to write a pre request script which will run before the actual API call and do...
Read more >
Using Postman Pre-Request Script for JWT authentication
Pre -request scripts are snippets of code associated with a collection request that are executed before the request is sent. This is perfect...
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