Skip to content

Instantly share code, notes, and snippets.

@juanpabloaj
Last active August 29, 2015 14:03
Show Gist options
  • Save juanpabloaj/4dbb58be44ac18b681b1 to your computer and use it in GitHub Desktop.
Save juanpabloaj/4dbb58be44ac18b681b1 to your computer and use it in GitHub Desktop.
python test and git with grunt
module.exports = function(grunt){
grunt.initConfig({
watch: {
grunt: {
files: ['Gruntfile.js']
},
python: {
files : ['./tests/*.py','./*/*.py'],
tasks: ['pythontest','gitst'],
},
gitindex: {
files : ['.git/index'],
tasks: ['gitst'],
},
}
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.registerTask('pythontest', function(){
grunt.util.spawn({
cmd: 'python',
args: ['setup.py','test'],
opts: {stdio: 'inherit'},
});
});
grunt.registerTask('gitst', function(){
grunt.util.spawn({
cmd: 'git',
args: ['status'],
opts: {stdio: 'inherit'},
});
});
grunt.registerTask('default', ['watch']);
};
{
"name": "pythontest",
"version": "0.0.1",
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-watch": "^0.6.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment