public function run($args)
    {
        if (!isset($args[0]) || !$args[0]) {
            return "> Producer: Project directory required.\n";
        }

        $name = trim($args[0]);
        if (!is_dir($path = $this->cwd.'/repository/'.$name)) {
            return "> Producer: Project directory 'repository/{$name}' not found.\n";
        }

        echo $this->info("Reset progect '{$name}'");

        $repo = trim($this->exec('reset-origin', [$path]));

        $purge = new PurgeCommand($this->cwd);
        echo $purge->run([$name]);

        $clone = new CloneCommand($this->cwd);
        echo $clone->run([$repo, $name]);
    }
public function run($args)
    {
        if (!isset($args[0]) || !$args[0]) {
            return "> Producer: Project directory required.\n";
        }

        $name = trim($args[0]);
        if (!is_dir($path = $this->cwd.'/repository/'.$name)) {
            return "> Producer: Project directory 'repository/{$name}' not found.\n";
        }

        echo $this->info("Reset progect '{$name}'");

        $repo = trim($this->exec('reset-origin', [$path]));

        $purge = new PurgeCommand($this->cwd);
        echo $purge->run([$name]);

        $clone = new CloneCommand($this->cwd);
        echo $clone->run([$repo, $name]);
    }
public function run ( $ args ) { if ( ! isset ( $ args [ 0 ] ) || ! $ args [ 0 ] ) { return "> Producer: Project directory required.\n" ; } $ name = trim ( $ args [ 0 ] ) ; if ( ! is_dir ( $ path = $ this -> cwd . '/repository/' . $ name ) ) { return "> Producer: Project directory 'repository/{$name}' not found.\n" ; } echo $ this -> info ( "Reset progect '{$name}'" ) ; $ repo = trim ( $ this -> exec ( 'reset-origin' , [ $ path ] ) ) ; $ purge = new PurgeCommand ( $ this -> cwd ) ; echo $ purge -> run ( [ $ name ] ) ; $ clone = new CloneCommand ( $ this -> cwd ) ; echo $ clone -> run ( [ $ repo , $ name ] ) ; }
Run reset command.

@param $args

@return string
Run reset command .