Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

new:site with Composer install #117

Open
alexfornuto opened this issue Apr 11, 2019 · 2 comments
Open

new:site with Composer install #117

alexfornuto opened this issue Apr 11, 2019 · 2 comments

Comments

@alexfornuto
Copy link

Issue

Hi there! I'm testing Spress as a replacement for my docs site. I'd like for the entire site and its tools to live in one directory, with the tools managed by Composer. The issue is that spress site:new will not work in the same directory it's installed in.

Steps to reproduce

  1. In a new directory, install Spress with Composer:
$ mkdir spress
$ cd spress
$ composer require spress/spress
Using version ^2.2 for spress/spress
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 43 installs, 0 updates, 0 removals
 ...
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/event-dispatcher suggests installing symfony/dependency-injection ()
symfony/http-kernel suggests installing symfony/browser-kit ()
symfony/http-kernel suggests installing symfony/dependency-injection ()
symfony/http-kernel suggests installing symfony/var-dumper ()
react/event-loop suggests installing ext-libevent (>=0.1.0)
react/event-loop suggests installing ext-event (~1.0)
react/event-loop suggests installing ext-libev (*)
yosymfony/config-loader suggests installing yosymfony/toml (0.3.*)
Writing lock file
Generating autoload files
  1. Attempt to init a new site:
$ vendor/bin/spress new:site

Generating a site using the theme: "blank"...

                                      
  [RuntimeException]                  
  Path "./" exists and is not empty.  
                                      

new:site [--force] [--all] [--prefer-source] [--prefer-lock] [--no-scripts] [--] [<path>] [<theme>]
  1. Attempt to override:
$ vendor/bin/spress new:site --force .

Generating a site using the theme: "blank"...
PHP Fatal error:  Uncaught Error: Class 'Symfony\Component\Debug\Exception\FatalThrowableError' not found in /home/alex/repos/spress/vendor/symfony/console/Application.php:129
Stack trace:
#0 /home/alex/repos/spress/vendor/spress/spress/bin/spress(61): Symfony\Component\Console\Application->run()
#1 {main}
  thrown in /home/alex/repos/spress/vendor/symfony/console/Application.php on line 129

Fatal error: Uncaught Error: Class 'Symfony\Component\Debug\Exception\FatalThrowableError' not found in /home/alex/repos/spress/vendor/symfony/console/Application.php:129
Stack trace:
#0 /home/alex/repos/spress/vendor/spress/spress/bin/spress(61): Symfony\Component\Console\Application->run()
#1 {main}
  thrown in /home/alex/repos/spress/vendor/symfony/console/Application.php on line 129

This error seems to be caused by --force deleting the contents of the directory.

Suggested Resolution

For now I can continue testing by initializing the site into a site subdirectory, but I think a better solution would be for new:site to ignore vendor, composer.json, and composer.lock.

@yosymfony
Copy link
Member

can't you create just a subfolder for Spress?

@alexfornuto
Copy link
Author

Yes, and I did as stated under **Suggested Resolution", but I think that this change would improve the ability to use Spress as a self-contained project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants