creates a spawn process and clones the repos
497889
function cloneRepo(item){

      var deferred = Q.defer();
      var repoURL = item.repo;
      var path = item.path;

      deleteOldFiles(path).
      then(function(){
        return performCmd(repoURL, path);
      }).then(function(success){
        return npmInstall(path, success);
      }).then(function(success){
        return bowerInstall(path, success);
      }).then(function(){
        deferred.resolve();
      });

      return deferred.promise;

    }
1128670
public static function clone()
    {
    	$bowerDir = 'vendor' . DIRECTORY_SEPARATOR . self::$sourceBower;

        $bowerYiiDir = 'vendor' . DIRECTORY_SEPARATOR . self::$bowerVendor;

    	try {
    		
    		self::deleteDir($bowerYiiDir);

        	self::copyDir($bowerDir, $bowerYiiDir);

        	echo "Clone bower process done\n";

    	} catch (Exception $e) {
    		
    		echo "Error on clone bower process\n";
    	}
    }
230282
def clone_repo(self):
        """"""
        tempdir_path = tempfile.mkdtemp()

        if self.args.git:
            self.log.debug('Cloning git source repository from %s to %s',
                           self.source, tempdir_path)
            self.sh('git clone', self.source, tempdir_path)

        else:
            raise NotImplementedError('Unknown repo type')

        self.source = tempdir_path
101033
def clone(url, tmpdir=None):
    ''''''
    if tmpdir is None:
        tmpdir = tempfile.mkdtemp()
    name = os.path.basename(url).replace('.git', '')
    dest = '%s/%s' %(tmpdir,name)
    return_code = os.system('git clone %s %s' %(url,dest))
    if return_code == 0:
        return dest
    bot.error('Error cloning repo.')
    sys.exit(return_code)
769614
def clone(self):
        
        return Monitor(org=self.org, app=self.app, env=self.env)
44718
def spawn_new(self, key):
        """"""
        # Check if path exists
        if not os.path.exists(self.queue[key]['path']):
            self.queue[key]['status'] = 'failed'
            error_msg = "The directory for this command doesn't exist anymore: {}".format(self.queue[key]['path'])
            self.logger.error(error_msg)
            self.queue[key]['stdout'] = ''
            self.queue[key]['stderr'] = error_msg

        else:
            # Get file descriptors
            stdout, stderr = self.get_descriptor(key)

            if self.custom_shell != 'default':
                # Create subprocess
                self.processes[key] = subprocess.Popen(
                    [
                        self.custom_shell,
                        '-i',
                        '-c',
                        self.queue[key]['command'],
                    ],
                    stdout=stdout,
                    stderr=stderr,
                    stdin=subprocess.PIPE,
                    universal_newlines=True,
                    preexec_fn=os.setsid,
                    cwd=self.queue[key]['path']
                )
            else:
                # Create subprocess
                self.processes[key] = subprocess.Popen(
                    self.queue[key]['command'],
                    shell=True,
                    stdout=stdout,
                    stderr=stderr,
                    stdin=subprocess.PIPE,
                    universal_newlines=True,
                    preexec_fn=os.setsid,
                    cwd=self.queue[key]['path']
                )
            self.queue[key]['status'] = 'running'
            self.queue[key]['start'] = str(datetime.now().strftime("%H:%M"))

        self.queue.write()
798466
def create_execve(original_name):
    

    def new_execve(path, args, env):
        import os
        send_process_created_message()
        return getattr(os, original_name)(path, patch_args(args), env)

    return new_execve
756854
def git_clone_worker(queue):
    """"""
    while True:
        job = queue.get()
        if job is None:
            break
        git_url, path = job
        git_clone(git_url, path)
        queue.task_done()
827135
def spawn_api(self, app, decorator=None):
        """"""
        if decorator:
            assert type(decorator).__name__ == 'function'
        self.is_server = True
        self.app = app

        if self.local:
            # Re-generate client callers, this time as local and passing them the app
            self._generate_client_callers(app)

        return spawn_server_api(self.name, app, self.api_spec, self.error_callback, decorator)
897742
def clone(cls, srcpath, destpath):
        """"""
        # Mercurial will not create intermediate directories for clones.
        try:
            os.makedirs(destpath)
        except OSError as e:
            if not e.errno == errno.EEXIST:
                raise
        cmd = [HG, 'clone', '--quiet', '--noupdate', srcpath, destpath]
        subprocess.check_call(cmd)
        return cls(destpath)
535896
def spawn_process(self, process=None):
        
        if process is None:
            return False
        # start new child process
        pid = fork()
        if pid != 0:
            # parent process
            process.pid = pid
            self.PROCESSES[process.process_id] = process
            connections.close_all()
            return True
        # child process
        process.pid = getpid()
        # connection.connection.close()
        # connection.connection = None
        process.pre_init_process()
        process.init_process()
        process.run()
        sys.exit(0)
798411
def clone(self, folder, git_repository):
        
        os.makedirs(folder)
        git.Git().clone(git_repository, folder)
451319
def create_process(cmd, root_helper=None, addl_env=None, log_output=True):
    
    if root_helper:
        cmd = shlex.split(root_helper) + cmd
    cmd = map(str, cmd)

    log_output and LOG.info("Running command: %s", cmd)
    env = os.environ.copy()
    if addl_env:
        env.update(addl_env)

    obj = subprocess_popen(cmd, shell=False, stdin=subprocess.PIPE,
                           stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                           env=env)
    return obj, cmd
1051667
function (version, cmd, args) {
        return __awaiter(this, void 0, void 0, function* () {
            let binpath = yield getBinPath(version);
            let parentEnv = process.env;
            let childPath = binpath + path.delimiter + parentEnv.PATH;
            let env = Object.assign({}, parentEnv, { PATH: childPath });
            let spawnOpts = { cwd: process.cwd(), env: env };
            return Promise.resolve(child_process_1.spawn(cmd, args, spawnOpts));
        });
    }
385115
def initialize_repo(self):
        

        logging.info('Repo {} doesn\'t exist. Cloning...'.format(self.repo_dir))
        clone_args = ['git', 'clone']
        if self.depth and self.depth > 0:
            clone_args.extend(['--depth', str(self.depth)])
        clone_args.extend(['--branch', self.branch_name])
        clone_args.extend([self.git_url, self.repo_dir])
        yield from execute_cmd(clone_args)
        yield from execute_cmd(['git', 'config', 'user.email', 'nbgitpuller@example.com'], cwd=self.repo_dir)
        yield from execute_cmd(['git', 'config', 'user.name', 'nbgitpuller'], cwd=self.repo_dir)
        logging.info('Repo {} initialized'.format(self.repo_dir))
290779
function spawn_cmd(command, args, options) {
  if (!options) options = {}

  return new Promise((resolve, reject) => {
    let io = {stdout: [], stderr: []}
    let finish = () =>
      ({stdout: io.stdout.join(''), stderr: io.stderr.join('')})

    let child = child_process.spawn(command, args,
      Object.assign({stdio:'pipe'}, options))

    if (options.input) {
      child.stdin.write(options.input)
      child.stdin.end()
    } else if (options.stdin)
      options.stdin.pipe(child.stdin)

    child.on('error', err => reject( Object.assign({err, command, args}, finish()) ))
    child.on('exit', (exitCode,  exitSignal) => exitCode
       ? reject( Object.assign({exitCode, exitSignal, command, args}, finish()) )
       : resolve(finish()))

    child.stdout.on('data', data => io.stdout.push(data) )
    child.stderr.on('data', data => io.stderr.push(data) )
    return child })}
910285
def spawn(spec, kwargs, pass_fds=()):
    
    r, w = os.pipe()
    for fd in [r] + list(pass_fds):
        set_inheritable(fd, True)

    preparation_data = get_preparation_data()

    r_handle = get_handle(r)
    args, env = get_command_line(pipe_handle=r_handle)
    process = subprocess.Popen(args, env=env, close_fds=False)

    to_child = os.fdopen(w, 'wb')
    to_child.write(pickle.dumps([preparation_data, spec, kwargs]))
    to_child.close()

    return process