pressly / sup

Super simple deployment tool - think of it like 'make' for a network of servers
https://pressly.github.io/sup
MIT License
2.49k stars 177 forks source link

Supfile: Allow argument on script #48

Open v9n opened 8 years ago

v9n commented 8 years ago

Can we considering allow extra argument on script, right now, if I write this:

  cleanup-release:
    desc: Cleanup old release
    stdin: true
    script: ./scripts/deploy/release -t cleanup

and run I got error:

2016/01/05 10:42:04 CreateTasks(): open ./scripts/deploy/release -t cleanup: no such file or directory

Granted, I can create separate script to avoid passing argument, but having argument in script is much more powerful. I can also sync the whole repo, and use run which allow argument but that seems dirty and require an extra definition task.

I imagine it isn't that hard to add support for passing extra argument to script. Basically we can separate by space/tab to parse the script name and its argument, and if the script itself contains a space in its name or its path, we can require to put it in a quote. Or just not support having space in path/script name at all.

eduardonunesp commented 8 years ago

Yeah, the implementation wasn't prepared for receive parameters on script param, this will need a parsing in script params.

https://github.com/pressly/sup/blob/master/task.go#L49