src/hooks/Context.js
function Context(hook, opts) {
    var prop;
    this.hook = hook;

    //create new object, to avoid affecting input opts in other places
    //For example context.opts.plugin = Object is done, then it affects by reference
    this.opts = {};
    for (prop in opts) {
    if (opts.hasOwnProperty(prop)) {
        this.opts[prop] = opts[prop];
      }
    }
    this.cmdLine =  process.argv.join(' ');
    this.cordova = require('../cordova/cordova');
}
function Context(hook, opts) {
    var prop;
    this.hook = hook;

    //create new object, to avoid affecting input opts in other places
    //For example context.opts.plugin = Object is done, then it affects by reference
    this.opts = {};
    for (prop in opts) {
    if (opts.hasOwnProperty(prop)) {
        this.opts[prop] = opts[prop];
      }
    }
    this.cmdLine =  process.argv.join(' ');
    this.cordova = require('../cordova/cordova');
}
function Context ( hook , opts ) { var prop ; this . hook = hook ; //create new object, to avoid affecting input opts in other places //For example context.opts.plugin = Object is done, then it affects by reference this . opts = { } ; for ( prop in opts ) { if ( opts . hasOwnProperty ( prop ) ) { this . opts [ prop ] = opts [ prop ] ; } } this . cmdLine = process . argv . join ( ' ' ) ; this . cordova = require ( '../cordova/cordova' ) ; }
Creates hook script context
@constructor
@param {String} hook The hook type
@param {Object} opts Hook options
@returns {Object}
Creates hook script context