How to use the yeoman-environment.enforceUpdate function in yeoman-environment

To help you get started, we’ve selected a few yeoman-environment examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github yeoman / generator / lib / base.js View on Github external
});

  this.option('skip-install', {
    type: Boolean,
    desc: 'Do not automatically install dependencies',
    default: false
  });

  // checks required paramaters
  assert(this.options.env, 'You must provide the environment object. Use env#create() to create a new generator.');
  assert(this.options.resolved, 'You must provide the resolved path value. Use env#create() to create a new generator.');
  this.env = this.options.env;
  this.resolved = this.options.resolved;

  // Ensure the environment support features this yeoman-generator version require.
  require('yeoman-environment').enforceUpdate(this.env);

  this.description = this.description || '';

  this.async = function () {
    return function () {};
  };

  this.fs = FileEditor.create(this.env.sharedFs);
  this.conflicter = new Conflicter(this.env.adapter, this.options.force);

  // Mirror the adapter log method on the generator.
  //
  // example:
  // this.log('foo');
  // this.log.error('bar');
  this.log = this.env.adapter.log;
github yeoman / generator / lib / index.js View on Github external
});

    // Checks required parameters
    assert(
      this.options.env,
      'You must provide the environment object. Use env#create() to create a new generator.'
    );
    assert(
      this.options.resolved,
      'You must provide the resolved path value. Use env#create() to create a new generator.'
    );
    this.env = this.options.env;
    this.resolved = this.options.resolved;

    // Ensure the environment support features this yeoman-generator version require.
    require('yeoman-environment').enforceUpdate(this.env);

    this.description = this.description || '';

    this.async = () => () => {};

    this.fs = FileEditor.create(this.env.sharedFs);

    this.conflicter = new Conflicter(this.env.adapter, this.options.force, {
      bail: this.options.bail,
      ignoreWhitespace: this.options.whitespace,
      skipRegenerate: this.options.skipRegenerate,
      dryRun: this.options.dryRun
    });

    // Mirror the adapter log method on the generator.
    //

yeoman-environment

Handles the lifecyle and bootstrapping of generators in a specific environment

BSD-2-Clause
Latest version published 2 months ago

Package Health Score

86 / 100
Full package analysis