Skip to content

Assigning task object to data #157

@tjrosario

Description

@tjrosario

I'm trying to pull in svn info (using this package https://github.com/kevinkao/grunt-svn-info), and wanted to know how to pass the svn_info object to other tasks. I tried doing something below, but no luck. Could you shed some light on what I am doing wrong?

module.exports = function(grunt) {
    var configs, options;

    // load tasks from 'grunt_tasks/'
    grunt.loadTasks("grunt_tasks");

    options = {
        configPath: require("path").join(process.cwd(), "grunt_tasks"),
        init: true,
        pkg: grunt.file.readJSON("package.json"),
        data: {
            svn_info: '<%= svn_info %>'
        }
    };

    configs = require("load-grunt-config")(grunt, options);
};

/ * some task */
module.exports = function(grunt, data) {
  console.log(data.svn_info);
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions