src/Rocketeer/Services/Connections/Shell/Modules/Filesystem.php
protected function symlinkSwap($folder, $symlink)
    {
        if ($this->fileExists($symlink) && !$this->isSymlink($symlink)) {
            $this->removeFolder($symlink);
        }

        // Define name of temporary link
        $temporary = $symlink.'-temp';

        return $this->modulable->run([
            sprintf('ln -s %s %s', $folder, $temporary),
            sprintf('mv -Tf %s %s', $temporary, $symlink),
        ]);
    }
protected function symlinkSwap($folder, $symlink)
    {
        if ($this->fileExists($symlink) && !$this->isSymlink($symlink)) {
            $this->removeFolder($symlink);
        }

        // Define name of temporary link
        $temporary = $symlink.'-temp';

        return $this->modulable->run([
            sprintf('ln -s %s %s', $folder, $temporary),
            sprintf('mv -Tf %s %s', $temporary, $symlink),
        ]);
    }
protected function symlinkSwap ( $ folder , $ symlink ) { if ( $ this -> fileExists ( $ symlink ) && ! $ this -> isSymlink ( $ symlink ) ) { $ this -> removeFolder ( $ symlink ) ; } // Define name of temporary link $ temporary = $ symlink . '-temp' ; return $ this -> modulable -> run ( [ sprintf ( 'ln -s %s %s' , $ folder , $ temporary ) , sprintf ( 'mv -Tf %s %s' , $ temporary , $ symlink ) , ] ) ; }
Swap a symlink if possible.

@param string $folder
@param string $symlink

@return string
Swap a symlink if possible .