JoaoCarabetta / project-templates

Fast Project Templates
12 stars 3 forks source link

Change command structure #28

Open JoaoCarabetta opened 5 years ago

JoaoCarabetta commented 5 years ago

Currently, there is just one command:

start_project

This does not allow any argument or different template to be called.

My suggestion is to call the main command project-templates that can have plenty different options.

Starting a project with the basic template would be:

project-templates start basic

to call a different template:

project-templates start [template name]

The configuration file can also be modified from here:

project-templates config set name [new name]
project-templates config set account [new account]

What do you think @fernandascovino ?

fernandascovino commented 4 years ago

Very clever. Since bash doesn't have a nice way to create classes, I think we can make it in two ways:

  1. Change the executables.sh adding a main function like project-templates that one can do simple things like changing owners config
  2. Make it call other functions in the same files (like start_project) or it calls other .sh files with specific functions for creating different template projects

The second one is nicer, and it doesn't have any problems if all the files are in the same directory. What do you think, my dear @JoaoCarabetta ?

fernandascovino commented 4 years ago

For further reading: http://kfirlavi.herokuapp.com/blog/2012/11/14/defensive-bash-programming/