Public API  
Execute the command file

@param {String}   upperdir Path of the root of the container
@param {Function} callback
427094
function create(upperdir, callback)
{
  var workdir = upperdir.split('/')
  var user    = workdir.pop()
  var workdir = workdir.join('/')+'/.workdirs/'+user

  mkdirp(workdir, '0100', function(error)
  {
    if(error && error.code !== 'EEXIST') return callback(error)

    // Craft overlayed filesystem
    var type   = 'overlay'
    var extras =
    {
      lowerdir: '/',
      upperdir: upperdir,
      workdir : workdir
    }

    utils.mkdirMount(upperdir, type, MS_NOSUID, extras, function(error)
    {
      if(error) return callback(error)

      var arr =
      [
        {
          path: upperdir+'/dev',
          flags: MS_BIND,
          extras: {devFile: '/tmp/dev'}
        },
        {
          path: upperdir+'/proc',
          flags: MS_BIND,
          extras: {devFile: '/proc'}
        },
        {
          path: upperdir+'/tmp',
          type: 'tmpfs',
          flags: MS_NODEV | MS_NOSUID
        }
      ]

      each(arr, mkdirMountInfo, callback)
    })
  })
}
228649
function(callback) {

            var binary = binaries.bower;
            binary.command = 'bower --allow-root install';

            helper.runCommand(
                binary, path,
                'bower binary is not ready to use, fix this (npm install -g bower)  and retry ' +
                'installation of frontend dependencies manually'.grey,
                callback
            );
        }
641105
function chownDirectory(user, filePath, callback) {
  var cmd = 'chown ' + user + ' ' + filePath;
  exec(cmd, callback);
}
821505
function execute(/*args*/) {

  const command = prepare_command(arguments);
  ensure_executable(command);
  create_result_file_name(command);

  return platform.execute(command)
  //Handle Results
  .then(() => new Promise((resolve,reject) => {

    const results = get_results(command);
    if (results == null)
      resolve();

    if (is(results, Error))
      reject(Errors.NoResult);

    if (is(results.returned, Error))
      reject(new AfterEffectsError(results.returned.message));
    else
      resolve(results.returned);
  }));
}
1179612
function run(appName, command, callback) {
    commons.get(format('/%s/apps/%s/run/', deis.version, appName), callback);
  }
992477
def execute(self, callback=None):
        
        # Preprocess options to extract --settings and --pythonpath.
        # These options could affect the commands that are available, so they
        # must be processed early.
        self.parser = parser = NewOptionParser(prog=self.prog_name,
                             usage=self.usage_info,
#                             version=self.get_version(),
                             formatter = NewFormatter(),
                             add_help_option = False,
                             option_list=self.option_list)
        
        if not self.global_options:
            global_options, args = parser.parse_args(self.argv)
            global_options.apps_dir = os.path.normpath(os.path.join(global_options.project, 'apps'))
            handle_default_options(global_options)
            args = args[1:]
        else:
            global_options = self.global_options
            args = self.argv

        if global_options.envs:
            for x in global_options.envs:
                if '=' in x:
                    k, v = x.split('=')
                    os.environ[k.strip()] = v.strip()
                else:
                    print ('Error: environment variable definition (%s) format is not right, '
                           'shoule be -Ek=v or -Ek="a b"' % x)

        global_options.settings = global_options.settings or os.environ.get('SETTINGS', 'settings.ini')
        global_options.local_settings = global_options.local_settings or os.environ.get('LOCAL_SETTINGS', 'local_settings.ini')
        
        if callback:
            callback(global_options)
            
        if len(args) == 0:
            if global_options.version:
                print self.get_version()
                sys.exit(0)
            else:
                self.print_help(global_options)
                sys.ext(1)

        self.do_command(args, global_options)
756721
function exec(cmd, args, stdin, callback) {
            var stdout = concat();
            var stderr = concat();

            var process = child_process.spawn(cmd, args, {
                stdio: [stdin || 'ignore', 'pipe', 'pipe']
            });
            process.stdout.pipe(stdout);
            process.stderr.pipe(stderr);
            process.on('exit', function(code, signal) {
              var err;
              if (code) {
                err = new Error(code);
                err.code = code;
                err.signal = signal;
              }
              callback(err, stdout, stderr);
            });
            process.on('error', function (err) {
              callback(err, stdout, stderr);
            });
        }
430282
function (cmd, cb) {
  var internalCmd = internalCommand(cmd);
  if (internalCmd) {
    return cb(['info', internalCmd]);
  }
  $document.trigger('console:run', cmd);
}
678024
function handleEvent(cmd, context, filename, callback) {
  var event = JSON.parse(cmd)
  eventline.route(event)
}
258547
private void runPreStep(String folderPath) {
        Cli cli = new Cli();
        boolean success = false;
        List<String> compileOutput = cli.runCmd(folderPath, cli.getCommandParams(SBT, COMPILE));
        if (!compileOutput.isEmpty()) {
            if (compileOutput.get(compileOutput.size() - 1).contains(SUCCESS)) {
                success = true;
            }
        }
        if (!success) {
            logger.warn("Can't run '{} {}'", SBT, COMPILE);
        }
    }
952093
private boolean executePreStepCommand(String topLevelFolder) {
        String[] command;
        if (DependencyCollector.isWindows()) {
            command = getCommand(COMPOSER_BAT);
        } else {
            command = getCommand(COMPOSER);
        }
        String commandString = String.join(Constants.WHITESPACE, command);
        File file = new File(topLevelFolder + FORWARD_SLASH + COMPOSER_JSON);
        CommandLineProcess composerInstall = null;
        if (file.exists()) {
            logger.info("Running install command : {}", commandString);
            composerInstall = new CommandLineProcess(topLevelFolder, command);
        }
        try {
            composerInstall.executeProcessWithoutOutput();
        } catch (IOException e) {
            logger.warn("Could not run {} in folder {} : {}", commandString, topLevelFolder, e.getMessage());
            return true;
        }
        return composerInstall.isErrorInProcess();
    }
742165
function Run(path, options, callback) {
    var p = Spawn(path, options.args),
        err = "",
        data = "";

    if (options.remove !== false) {
        Fs.unlink(path, () => {});
    }

    if (options.stdin) {
        options.stdin.pipe(p.stdin);
    }

    if (options.stdout) {
        p.stdout.pipe(options.stdout);
    } else {
        p.stdout.on("data", function (chunk) {
            data += chunk.toString();
        });
    }

    if (options.stderr) {
        p.stderr.pipe(options.stderr);
    } else {
        p.stderr.on("data", function (err) {
            err += err.toString();
        });
    }

    p.on("close", function () {
        callback([null, err][Number(!!err)], data.slice(0, -1));
    });
}
380290
function run(params, command, callback)
{
  var terminator
    , requiresContext = isArrowFunction(command)
    ;

  // make sure callback is invoked in real async way
  callback = async(callback);

  // check provided function if it expected
  // to be run in async or sync way

  // expects no arguments, run it as sync function
  // unless it's function straight outta factory
  // has `.commandDescription` property
  //
  // Or it has one argument and requires context
  // must be arrow function with `context` argument
  if ((command.length === 0 || (command.length === 1 && requiresContext)) && !command.commandDescription)
  {
    runSync(this, command, callback);
  }
  else // or run it as async
  {
    // async function may return terminator function
    terminator = runAsync(this, command, callback);
  }

  // return provided terminator or empty function
  // if there is none
  return terminator || function() {};
}
1207712
function processDir(options, callback) {
  return fs.readdir(options.path, function(err, filenames) {
    if (err) {
      return callback(err);
    }

    if (options.ignoreDotFiles) {
      filenames = _.filter(filenames, function(filename) {
        return filename[0] !== ".";
      });
    }

    return async.map(filenames, function(filename, done) {
      const abspath = path.join(options.path, filename);

      if (options.statEach === false) {
        return done(null, {
          filename,
          path: abspath,
        });
      }

      stat(abspath, function(statErr, stats) {
        if (statErr) {
          return done(statErr);
        }
        return done(null, stats);
      });
    }, function(mapErr, statsMap) {
      if (mapErr) {
        return callback(err);
      }

      if (!options.ignoreCurDir) {
        const stats = _.cloneDeep(options.dirStats);
        stats.filename = ".";
        statsMap.push(stats);
      }

      if (!options.ignoreUpDir) {
        const abspath = path.join(options.path, "..");
        return stat(abspath, function(statErr, stats) {
          if (err) {
            return callback(err);
          }
          stats.filename = "..";
          statsMap.push(stats);
          return callback(null, statsMap);
        });
      }

      return callback(null, statsMap);
    });
  });
}
1359375
function exec(cmd, args, opts) {
  console.log(`Running command: ${cmd} ${args.join(' ')}`);
  const cp = childProcessSpawn(cmd, args, opts);

  cp.stdout.on('data', data => log(data));
  cp.stderr.on('data', data => log(data));

  return new Promise((resolve, reject) => {
    cp.on('error', err => reject(log(err)));
    cp.on('exit', code => resolve(code));
  });
}
172211
function handle(options, callback) {
  if (_.isString(options)) {
    options = { path: options };
  }

  if (_.isObject(options)) {
    const opts = { };
    _.merge(opts, config, options);
    options = opts;
  } else {
    options = _.cloneDeep(config);
  }

  options.path = options.path || config.get("home");
  return stat(options.path, function(err, stats) {
    if (err) {
      return callback(err);
    }

    const done = wrap(stats, callback);

    if (stats.isDirectory()) {
      options.dirStats = stats;
      return processDir(options, done);
    } else if (stats.isFile()) {
      return processFile(options, done);
    }

    return callback(null, null);
  });
}
592064
function exec() {

  var actions = {
    commands: {
      init: { action: _init },
      run : { action: _run }
    }
  };

  cli.command(__dirname, actions);
}