devgeniem / gdev

Helper script for developing containerized web applications.
https://devgeniem.github.io/gdev/
MIT License
29 stars 16 forks source link

gdev create fails if theme arg empty or defined theme has missing directories #43

Open mtws opened 7 years ago

mtws commented 7 years ago

When running the gdev create wizard and not defining a theme repo gdev create will fail. Example of gdev create output when living the theme repo empty:

------------------------= Confirm input =------------------------
sitename: dp2017Demo
type: wordpress
components: dustpress
theme:
npm_install: false
run_seed: false
stage:
production:
git:
-----= Enter Y to create project, something else to cancel =-----

Y

Creating project dp2017Demo...

...

Cloning theme from ...
fatal: repository 'dp2017Demo/web/app/themes/dp2017Demo' does not exist

Removing .git directory from theme...

...

Replacing 'THEMENAME' strings from all project files with 'dp2017Demo'...
/usr/local/bin/gdev:559:in `read': No such file or directory - dp2017Demo/web/app/themes/dp2017Demo/lib/extras.php (Errno::ENOENT)
    from /usr/local/bin/gdev:559:in `block in create_app'
    from /usr/local/bin/gdev:558:in `each'
    from /usr/local/bin/gdev:558:in `create_app'
    from /usr/local/bin/gdev:794:in `create_wizard'
    from /usr/local/bin/gdev:491:in `create'
    from /usr/local/bin/gdev:54:in `initialize'
    from /usr/local/bin/gdev:867:in `new'
    from /usr/local/bin/gdev:867:in `<main>'

gdev create will also fail with the above output if a theme repo has been defined but the theme does not include some of the following files: