Tonkpils / snag

Automatic build tool for all your projects
MIT License
32 stars 4 forks source link

Command to generate snag.yml #52

Closed Tonkpils closed 8 years ago

Tonkpils commented 8 years ago

It would be nice to include a command that can generate a snag yml file in the current directory. We could possibly extend this command to include build and run scripts as well as the verbose option but this is TBD. Thoughts?

zabawaba99 commented 8 years ago

I think there would be a huge benefit to an init command. However, I would probably stray away from passing things in through the command. What you would think about something like:

$ snag init
Initializing your project to use snag.
Below type the command that you want snag to run everytime you make a code change.
Hit the return key twice to move to the next question
Enter your build command(1): go build .
Enter your build command(2): go vet ./...
Enter your build command(3):

Verbose (y/n): y
All setup. Run snag again to start automating your workflow

And that would generate a .snag.yml file that looks like

verbose: true

build:
  - go build .
  - go vet ./...
Tonkpils commented 8 years ago

Hm, I'd have to play around with something like that to see if it's worth the effort or if it'd b easier to just open up an editor and add the commands. What if we just created the file with the corresponding fields and some comments to start off and we can iterate over that?

zabawaba99 commented 8 years ago

I think that'd be a good starting point. A guided process may make the overall setup easier but it may not be worth the effort since you probably won't be changing the snag.yml too much after you get it to your liking.

I'd say lets go with a generated file with comments.