protected function processSharedFileMounts()
    {
        $sharedDir = $this->getSharedDir();
        if ($sharedDir === false) {
            return;
        }

        // If the build directory is a symlink, then skip, so that we don't risk
        // modifying the user's repository.
        if (is_link($this->buildDir)) {
            return;
        }

        $sharedFileMounts = $this->app->getSharedFileMounts();
        if (empty($sharedFileMounts)) {
            return;
        }

        $sharedDirRelative = $this->config->get('local.shared_dir');
        $this->stdErr->writeln('Creating symbolic links to mimic shared file mounts');
        foreach ($sharedFileMounts as $appPath => $sharedPath) {
            $target = $sharedDir . '/' . $sharedPath;
            $targetRelative = $sharedDirRelative . '/' . $sharedPath;
            $link = $this->buildDir . '/' . $appPath;
            if (file_exists($link) && !is_link($link)) {
                $this->stdErr->writeln('  Removing existing file <comment>' . $appPath . '</comment>');
                $this->fsHelper->remove($link);
            }
            if (!file_exists($target)) {
                $this->fsHelper->mkdir($target, 0775);
            }
            $this->stdErr->writeln(
                '  Symlinking <info>' . $appPath . '</info> to <info>' . $targetRelative . '</info>'
            );
            $this->fsHelper->symlink($target, $link);
        }
    }