How to use the private/core.cwd function in private

To help you get started, we’ve selected a few private 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 seedjs / seed / lib / commands / unfreeze.js View on Github external
exports.invoke = function(cmd, args, opts, done) {
  
  var working = CORE.cwd(),
      force   = false;
      
  opts.on('working', function(k,v) { working = v; });
  opts.on('force', function() { force = true; });
  opts.on('no-force', function() { force= false; });
  
  var packageIds = opts.parse(args); 

  if (packageIds.length===0) {
    return done(new Error("Package name required"));
  }

  // first we need to find the working package to install in
  (function(done) {
    working = CORE.path.normalize(working);
    CORE.async(function() {
github seedjs / seed / lib / commands.js View on Github external
Cmds.invoke = function(cmd, args, done) {
  if (arguments.length<2) {
    throw new Error("invoke() requires least cmd and callback");
  }

  if (!cmd) cmd = 'help';
  
  // Find nearest package and automatically register it so you can work inside 
  // of a project
  var pkg = require.loader.openNearestPackage(CORE.cwd());
  if (pkg) require.loader.register(pkg.path);
  
  Cmds.commands(function(err, commands) {
    if (err) return done(err);
    var packageId = commands[cmd.toLowerCase()], exports;
    if (packageId) {
      try {
        exports = require(packageId);
      } catch(e) {
        exports = null;
      }
    }

    var opts = new optparse.OptionParser(STD_SWITCHES);
    
    if (!exports || !exports.invoke) {
github seedjs / seed / lib / commands / freeze.js View on Github external
exports.invoke = function(cmd, args, opts, done) {
  
  var working = CORE.cwd(),
      version = null,
      force   = false,
      dirname = 'packages';
      
  opts.on('working', function(k,v) { working = v; });
  opts.on('version', function(k,v) { version = v; });
  opts.on('force', function() { force = true; });
  opts.on('no-force', function() { force= false; });
  opts.on('dir', function(k,v) { dirname = v; });
  
  var packageIds = opts.parse(args); 

  if (packageIds.length===0) {
    return done(new Error("Package name required"));
  }
github seedjs / seed / lib / commands / fork.js View on Github external
exports.invoke = function(cmd, args, opts, done) {
  
  var working = CORE.cwd(),
      version = null,
      force   = false,
      dirname = 'packages';
      
  opts.on('working', function(k,v) { working = v; });
  opts.on('version', function(k,v) { version = v; });
  opts.on('force', function() { force = true; });
  opts.on('no-force', function() { force= false; });
  opts.on('dir', function(k,v) { dirname = v; });
  
  var packageIds = opts.parse(args); 

  if (packageIds.length===0) {
    return done(new Error("Package name required"));
  }