gruntjs - Passing arguments from command line to grunt copy task -
var pathvalue=""; module.exports = function(grunt) { grunt.initconfig({ copy: { main: { files: [{ cwd: 'srcpath', // set working folder / root copy src: '**/*', // copy files , subfolders dest: 'pathvalue', // destination folder expand: true }] } } }); grunt.loadnpmtasks('grunt-contrib-copy'); grunt.registertask('copy', function(n) { var target = grunt.option('target'); pathvalue = target; // useful target here }); };
i'm trying pass destination path copy task command line. tired command
grunt copy --target=destpath
it says "done without errors" new folder not getting created in destination directory. can please tell me what's error in code?
try changing dest qualified js file path. this:
dest: 'dest/bob.js'
Comments
Post a Comment