protected function execute(InputInterface $input, OutputInterface $output)
    {
        // Get the current version or generate a new one if the user has confirm that this is required
        try {
            $currentVersion = Context::get('version-persister')->getCurrentVersion();
        } catch (\Liip\RMT\Exception\NoReleaseFoundException $e) {
            if (Context::get('information-collector')->getValueFor('confirm-first') == false) {
                throw $e;
            }
            $currentVersion = Context::get('version-generator')->getInitialVersion();
        }
        Context::getInstance()->setParameter('current-version', $currentVersion);

        // Generate and save the new version number
        $newVersion = Context::get('version-generator')->generateNextVersion(
            Context::getParam('current-version')
        );
        Context::getInstance()->setParameter('new-version', $newVersion);

        $this->executeActionListIfExist('pre-release-actions');

        $this->getOutput()->writeSmallTitle('Release process');
        $this->getOutput()->indent();

        $this->getOutput()->writeln("A new version named [<yellow>$newVersion</yellow>] is going to be released");
        Context::get('version-persister')->save($newVersion);
        $this->getOutput()->writeln('Release: <green>Success</green>');

        $this->getOutput()->unIndent();

        $this->executeActionListIfExist('post-release-actions');
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        // Get the current version or generate a new one if the user has confirm that this is required
        try {
            $currentVersion = Context::get('version-persister')->getCurrentVersion();
        } catch (\Liip\RMT\Exception\NoReleaseFoundException $e) {
            if (Context::get('information-collector')->getValueFor('confirm-first') == false) {
                throw $e;
            }
            $currentVersion = Context::get('version-generator')->getInitialVersion();
        }
        Context::getInstance()->setParameter('current-version', $currentVersion);

        // Generate and save the new version number
        $newVersion = Context::get('version-generator')->generateNextVersion(
            Context::getParam('current-version')
        );
        Context::getInstance()->setParameter('new-version', $newVersion);

        $this->executeActionListIfExist('pre-release-actions');

        $this->getOutput()->writeSmallTitle('Release process');
        $this->getOutput()->indent();

        $this->getOutput()->writeln("A new version named [<yellow>$newVersion</yellow>] is going to be released");
        Context::get('version-persister')->save($newVersion);
        $this->getOutput()->writeln('Release: <green>Success</green>');

        $this->getOutput()->unIndent();

        $this->executeActionListIfExist('post-release-actions');
    }
protected function execute ( InputInterface $ input , OutputInterface $ output ) { // Get the current version or generate a new one if the user has confirm that this is required try { $ currentVersion = Context :: get ( 'version-persister' ) -> getCurrentVersion ( ) ; } catch ( \ Liip \ RMT \ Exception \ NoReleaseFoundException $ e ) { if ( Context :: get ( 'information-collector' ) -> getValueFor ( 'confirm-first' ) == false ) { throw $ e ; } $ currentVersion = Context :: get ( 'version-generator' ) -> getInitialVersion ( ) ; } Context :: getInstance ( ) -> setParameter ( 'current-version' , $ currentVersion ) ; // Generate and save the new version number $ newVersion = Context :: get ( 'version-generator' ) -> generateNextVersion ( Context :: getParam ( 'current-version' ) ) ; Context :: getInstance ( ) -> setParameter ( 'new-version' , $ newVersion ) ; $ this -> executeActionListIfExist ( 'pre-release-actions' ) ; $ this -> getOutput ( ) -> writeSmallTitle ( 'Release process' ) ; $ this -> getOutput ( ) -> indent ( ) ; $ this -> getOutput ( ) -> writeln ( "A new version named [<yellow>$newVersion</yellow>] is going to be released" ) ; Context :: get ( 'version-persister' ) -> save ( $ newVersion ) ; $ this -> getOutput ( ) -> writeln ( 'Release: <green>Success</green>' ) ; $ this -> getOutput ( ) -> unIndent ( ) ; $ this -> executeActionListIfExist ( 'post-release-actions' ) ; }
Always executed, but first initialize and interact have already been called

{@inheritdoc}
Always executed but first initialize and interact have already been called