module.exports = function(grunt) { // Project configuration. grunt.initConfig({ pkg: '', meta: { name: '<%= pkg.name.replace(/-/g, " ") %>', repo: 'https://github.com/MayhemYDG/4chan-x/', files: { metajs: '4chan_x.meta.js', userjs: '4chan_x.user.js', latestjs: 'latestv3.js' } }, concat: { coffee: { src: [ '', '', '', '', '', '', '' ], dest: 'tmp/script.coffee' }, script: { src: ['', '', 'tmp/script.js'], dest: '' }, meta: { src: '', dest: '' }, latest: { src: '', dest: '' } }, coffee: { script: { src: 'tmp/script.coffee', dest: 'tmp/script.js' } }, exec: { commit: { command: function(grunt) { var name, release, version; name = grunt.config(['pkg', 'name']).replace(/-/g, ' '); version = grunt.config(['pkg', 'version']); release = name + ' v' + version; return [ 'git checkout master', 'git commit -am "Release ' + release + '."', 'git tag -a ' + version + ' -m "' + release + '"', 'git tag -af stable -m "' + release + '"' ].join(' && '); }, stdout: true }, push: { command: 'git push && git push --tags', stdout: true } }, watch: { files: [ 'grunt.js', 'lib/**/*.coffee', 'src/**/*.coffee', 'src/**/*.js', 'css/**/*.css', 'img/*' ], tasks: 'default' }, clean: { tmp:['tmp'] }, qunit: { all: 'http://localhost:8000/test/index.html' }, server: { port: 8000, base: '.' } }); grunt.loadNpmTasks('grunt-bump'); grunt.loadNpmTasks('grunt-contrib-clean'); grunt.loadNpmTasks('grunt-contrib-coffee'); grunt.loadNpmTasks('grunt-exec'); grunt.registerTask('default', 'concat:coffee coffee:script concat:script clean'); grunt.registerTask('release', 'concat:meta concat:latest default exec:commit exec:push'); grunt.registerTask('patch', 'bump'); grunt.registerTask('upgrade', 'bump:minor'); grunt.registerTask('test', 'default server qunit'); };