Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- grunt-shell
- //Gruntfile.js
- module.exports= function(grunt){
- grunt.initConfig({
- pack: grunt.file.readJSON('package.json'),
- shell:{//task
- listFolders: { //Target
- options:{ //options
- stdout:true
- },
- command:'ls'
- },// end of target list folders
- makedir: {
- command:'mkdir test'
- },
- multiple : {
- command: [
- 'mkdir Sample',
- 'cd Sample',
- 'ls'
- ].join('&&')
- }
- }
- });
- grunt.loadNpmTasks('grunt-shell');
- grunt.registerTask('default',['shell']);
- grunt.registerTask('makedir',['shell']);
- grunt.registerTask('multi',['shell:multiple']);
- };
- //package.json
- {
- "name": "Grunt_Shelljs",
- "version": "0.0.1",
- "description": "Used for running Shell commands in gruntjs",
- "main": "index.js",
- "scripts": {
- "test": "echo \"Error: no test specified\" && exit 1"
- },
- "keywords": [
- "Unix",
- "Commands",
- "shell",
- "commands",
- "for",
- "gruntjs"
- ],
- "author": "Varun Krishna. P",
- "license": "BSD-2-Clause",
- "devDependencies": {
- "grunt": "~0.4.2",
- "grunt-shell": "~0.6.1"
- }
- }
- I'm running under windows, so the ls command is not working if I call the task.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement