sebastianhallen / Goose

Configure powershell commands that will be run when saving files that matches a specific glob.
http://sebastianhallen.github.com/Goose/
Other
3 stars 0 forks source link

Change config to be less less specific #5

Closed tregusti closed 11 years ago

tregusti commented 11 years ago

Pun intended.

sebastianhallen commented 11 years ago

would the following structure work?

<on-save-action>
  <working-directory>Build</working-directory>
  <powershell-command>$now = Get-Date ; Add-Content build.log "Last build: $now"</powershell-command> 
</on-save-action>
sebastianhallen commented 11 years ago

new branch pushed with propsed format

tregusti commented 11 years ago

I gather that you by naming it open up for doing stuff on open, or on other event too in a much later iteration? In that case I propose <action on="save"> instead.

And also, is it necessarily a powershell command? Are you invoking powershell explicitly?

What happens if you don't have ps.exe installed?

sebastianhallen commented 11 years ago

As of now the only implenentation IOnSaveActionTaskFactory.cs is RunPowerShellCommandOnSaveActionTaskFactory.cs. It would be possible to specify another task factory via config and perhaps default to power shell. If you don't have powershell installed you will get an error in the task list with stack trace indicating that powershell is not available.

sebastianhallen commented 11 years ago

How about?

<action on="save">
  <working-directory>Build</working-directory>
  <type>powershell</type>
  <arguments>$now = Get-Date ; Add-Content build.log "Last build: $now"</arguments>
</action>
tregusti commented 11 years ago

Good. type should be optional though. And use command instead of arguments. Might be confusing with args to the command (node.exe) you want to run.

'type' or 'shell' ?

On 31 jan 2013, at 09:20, sebastianhallen notifications@github.com wrote:

How about?

Build powershell $now = Get-Date ; Add-Content build.log "Last build: $now"

— Reply to this email directly or view it on GitHub.

sebastianhallen commented 11 years ago

shell makes sense.

<action on="save">
  <working-directory>Build</working-directory>
  <!-- explicit shell -->
  <command shell="powershell">$now = Get-Date ; Add-Content build.log "Last build: $now"</arguments>
</action>
<action on="save">
  <working-directory>Build</working-directory>
  <!-- default shell: powershell -->
  <command>$now = Get-Date ; Add-Content build.log "Last build: $now"</arguments>
</action>
tregusti commented 11 years ago

How to specify explicit default shell? =)

dos? cmd? crapshell? shellfish.

On 31 jan 2013, at 13:36, sebastianhallen notifications@github.com wrote:

shell makes sense.

Build