tighten / lambo

Quick new application creation with Laravel and Valet
MIT License
612 stars 52 forks source link

Allow presets #39

Open mattstauffer opened 7 years ago

mattstauffer commented 7 years ago

For example:

lambo --preset=API FacebookForPets

I think that would read a separate shell script after after.sh in something like ~/.lambo/presets/API.sh.

Other examples:

lambo --preset=fractal FacebookForPets
lambo --preset=API FacebookForPets
lambo --preset=jsend FacebookForPets
lambo --preset=adminCrud FacebookForPets
lambo --preset=spark FacebookForPets
milose commented 7 years ago

Perhaps enable running of multiple presets: lambo --preset=adminCrud,mysql

mattstauffer commented 7 years ago

@milose yah, i like that idea

tucq88 commented 7 years ago

What exactly presets would work ? I dont get it clearly :D

mattstauffer commented 7 years ago

Hi @tucq88; imagine you might want to run a certain set of commands for every project that was going to be an API but a different set of commands for every project that was going to have an admin panel and a different set of commands for each project that was going to use Spark.

Each of those would be a "preset". And like I referenced above, it would likely live in ~/.lambo/presents/:presetname:.sh or something like that.

quickliketurtle commented 7 years ago

Hey @mattstauffer , working on this now and have a couple of thoughts.

Will start with naive implementation just accepting any string and matching to a file in ~/.lambo/presets/API.sh following the current structure of option [space] string to keep it consistent. lambo --preset API would try to match ~/.lambo/presets/API.sh or display warning that the preset does not exist. For an abbreviation -p is already taken by path, could use -s but none fit great... I think that will do as a first pass.

What are your thoughts about providing some presets for people like your examples? Should we create a preset folder with presets on the repo that people can download and use? Or just an example in the docs? Any need for a 'create preset' command? I'm thinking not and just keep it simple.

A subsequent update can be to switch all options from command [space] "string" to command="string". I like that format better and is consistent with other Laravel command options.

Next I'm thinking about the use case for the after file, with presets added. Being that it is commands that you want to run on 'every' project, maybe we create a 'default' or 'base' preset? At the very least it aligns the language and makes it more clear what the 'after' file is vs a 'preset'. Thoughts?

jonsugar commented 4 years ago

Work has started on this in the mes/presets branch as part of the port to PHP.

The API may not be exactly the same but the intention is.