Coder Social home page Coder Social logo

Comments (5)

shama avatar shama commented on July 19, 2024

The cmd option in grunt.util.spawn should be a string as it can only run a single command at a time. Also you'll need to mark your task as async with var done = this.async(); and then call done(); within your callback signifying your task is done.

See: http://gruntjs.com/api/grunt.util#grunt.util.spawn and http://gruntjs.com/frequently-asked-questions#why-doesn-t-my-asynchronous-task-complete

from grunt-contrib-connect.

shama avatar shama commented on July 19, 2024

Also I recommend using require('fs').readdir or readdirSync instead of spawning an ls command. It will make your gruntfile cross platform, faster and easier to maintain if you utilize as much of node as possible. http://nodejs.org/api/fs.html#fs_fs_readdir_path_callback

from grunt-contrib-connect.

Integralist avatar Integralist commented on July 19, 2024

Thanks. Appreciate the helpful comments. I'll do that.

from grunt-contrib-connect.

tayyabhussain avatar tayyabhussain commented on July 19, 2024

// I am facing same problem with this error ->> Warning: Object Editor.php,EditorDriver.php has no //method 'charAt' Use --force to continue.
// gruntfile.js and package.json are in same folder.. need help
Aborted due to warnings.

module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
phpmd: {
application: {
dir: ["Editor.php", 'EditorDriver.php']
},
options: {
rulesets: 'codesize',
bin: 'vendor/phpmd',
}
},
});
// Load required modules
grunt.loadNpmTasks('grunt-phpmd');
// Task definitions
grunt.registerTask('default', ['phpmd']);
};

from grunt-contrib-connect.

shama avatar shama commented on July 19, 2024

@tayyabhussain Object has no method 'charAt' usually occurs when something is expecting a String but gets something else in JavaScript.

For your case, looking at the grunt-phpmd docs, it looks like dir only accepts a string and not an array. Please open an issue there if you think it should otherwise. Thanks!

from grunt-contrib-connect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.