private function writeFile(
        InputInterface $input,
        OutputInterface $output,
        $path,
        $content
    ) {
        // A shorter path to the new file, relative to the site root.
        $shortPath = str_replace(getcwd() . '/', '', $path);

        /** @var Filesystem $filesystem */
        $filesystem = $this->getContainer()->get('filesystem');

        if (!$filesystem->exists($path) || $input->getOption('force')) {
            $filesystem->dumpFile($path, $content);

            $output->writeln('<info>' . sprintf('%s has been created.', $shortPath) . '</info>');
        } else {
            $output->writeln('<error>' . sprintf('%s already exists.', $shortPath) . '</error>');
        }

        return $this;
    }