wecodemore / grunt-githooks

A Grunt plugin to help bind Grunt tasks to Git hooks
https://npmjs.org/package/grunt-githooks
MIT License
317 stars 24 forks source link

Multiple commands on the same hook overwrite each other #39

Open morganestes opened 9 years ago

morganestes commented 9 years ago

With v0.3.1: I've tried to add multiple commands to a single hook, but they get overwritten and only the last one survives. Specifically, I'm trying to get npm, Composer, and Bower to all update on the same hook, then have Grunt run, but each one overwrites the hook file and I'm only left with the Grunt command.

Here's an example of what I'm trying to do:

githooks: {
    'all': {
        'pre-commit': 'css js'
    },
    'dev.composer': {
        'post-merge': {
            command: 'composer',
            taskNames: 'update'
        },
        'post-checkout': {
            command: 'composer',
            taskNames: 'update'
        }
    },
    'dev.node': {
        'post-merge': {
            command: 'npm',
            taskNames: 'update'
        },
        'post-checkout': {
            command: 'npm',
            taskNames: 'update'
        }
    },
    'dev.bower': {
        'post-merge': {
            command: 'bower',
            taskNames: 'install update'
        },
        'post-checkout': {
            command: 'bower',
            taskNames: 'install update'
        }
    },
    'dev.grunt': {
        'post-merge': 'default',
        'post-checkout': 'default'
    }
},
franz-josef-kaiser commented 9 years ago

@morganestes Do you have a PR for us?

morganestes commented 9 years ago

@franz-josef-kaiser Not yet. I haven't figured out a fix for it, but I wanted to open an issue for reference even though I don't have a fix.

franz-josef-kaiser commented 9 years ago

That's ok. It will stay open until someone has time (and a solution). If it's open in a month or so, I'll clean up and close the issue.

franz-josef-kaiser commented 8 years ago

@morganestes Still open. Do you want to contribute and work on this one?

morganestes commented 8 years ago

Sorry, it's been on my list but I haven't had a chance to look at it yet. I do still want to work on it, but understand if you don't want long-running issues open.

franz-josef-kaiser commented 8 years ago

@morganestes I will just ping you from time to time. No problem with open issues.

franz-josef-kaiser commented 8 years ago

@morganestes FYI I added this to the backlog for 0.6.0 – every time I read it, I like this idea more and more.

franz-josef-kaiser commented 6 years ago

@morganestes because it's this time of the year :)