bundle/Command/SymlinkCommand.php
protected function verifyAndSymlinkDirectory(string $source, string $destination, OutputInterface $output): void
    {
        if ($this->fileSystem->exists($destination) && !is_link($destination)) {
            $output->writeln('<comment>' . basename($destination) . '</comment> already exists in <comment>' . dirname($destination) . '/</comment> and is not a symlink. Skipping...');

            return;
        }

        if ($this->forceSymlinks && is_link($destination)) {
            $this->fileSystem->remove($destination);
        }

        if ($this->fileSystem->exists($destination)) {
            $output->writeln('Skipped creating the symlink for <comment>' . basename($destination) . '</comment> in <comment>' . dirname($destination) . '/</comment>. Symlink already exists!');

            return;
        }

        $this->fileSystem->symlink(
            $this->fileSystem->makePathRelative(
                $source,
                realpath(dirname($destination))
            ),
            $destination
        );
    }
protected function verifyAndSymlinkDirectory(string $source, string $destination, OutputInterface $output): void
    {
        if ($this->fileSystem->exists($destination) && !is_link($destination)) {
            $output->writeln('<comment>' . basename($destination) . '</comment> already exists in <comment>' . dirname($destination) . '/</comment> and is not a symlink. Skipping...');

            return;
        }

        if ($this->forceSymlinks && is_link($destination)) {
            $this->fileSystem->remove($destination);
        }

        if ($this->fileSystem->exists($destination)) {
            $output->writeln('Skipped creating the symlink for <comment>' . basename($destination) . '</comment> in <comment>' . dirname($destination) . '/</comment>. Symlink already exists!');

            return;
        }

        $this->fileSystem->symlink(
            $this->fileSystem->makePathRelative(
                $source,
                realpath(dirname($destination))
            ),
            $destination
        );
    }
protected function verifyAndSymlinkDirectory ( string $ source , string $ destination , OutputInterface $ output ) : void { if ( $ this -> fileSystem -> exists ( $ destination ) && ! is_link ( $ destination ) ) { $ output -> writeln ( '<comment>' . basename ( $ destination ) . '</comment> already exists in <comment>' . dirname ( $ destination ) . '/</comment> and is not a symlink. Skipping...' ) ; return ; } if ( $ this -> forceSymlinks && is_link ( $ destination ) ) { $ this -> fileSystem -> remove ( $ destination ) ; } if ( $ this -> fileSystem -> exists ( $ destination ) ) { $ output -> writeln ( 'Skipped creating the symlink for <comment>' . basename ( $ destination ) . '</comment> in <comment>' . dirname ( $ destination ) . '/</comment>. Symlink already exists!' ) ; return ; } $ this -> fileSystem -> symlink ( $ this -> fileSystem -> makePathRelative ( $ source , realpath ( dirname ( $ destination ) ) ) , $ destination ) ; }
Verify that source directory can be symlinked to destination and do symlinking if it can.
Verify that source directory can be symlinked to destination and do symlinking if it can .