ash-project / igniter

A code generation and project patching framework.
https://hexdocs.pm/igniter/readme.html
MIT License
147 stars 18 forks source link

mix igniter.new gives "file already exists" error #116

Closed ddon closed 4 hours ago

ddon commented 4 hours ago

Describe the bug Taking a command from Ash docs and when running, getting "file already exists" error

To Reproduce just run

mix igniter.new testapp --install ash,ash_postgres --with phx.new --extend postgres

Expected behavior Project needs to be created.

** Runtime

Additional context

❯ mix igniter.new testapp --install ash,ash_postgres --with phx.new --extend postgres
* creating testapp/config/config.exs
* creating testapp/config/dev.exs
* creating testapp/config/prod.exs
* creating testapp/config/runtime.exs
* creating testapp/config/test.exs
* creating testapp/lib/testapp/application.ex
* creating testapp/lib/testapp.ex
* creating testapp/lib/testapp_web/controllers/error_json.ex
* creating testapp/lib/testapp_web/endpoint.ex
* creating testapp/lib/testapp_web/router.ex
* creating testapp/lib/testapp_web/telemetry.ex
* creating testapp/lib/testapp_web.ex
* creating testapp/mix.exs
* creating testapp/README.md
* creating testapp/.formatter.exs
* creating testapp/.gitignore
* creating testapp/test/support/conn_case.ex
* creating testapp/test/test_helper.exs
* creating testapp/test/testapp_web/controllers/error_json_test.exs
* creating testapp/lib/testapp/repo.ex
* creating testapp/priv/repo/migrations/.formatter.exs
* creating testapp/priv/repo/seeds.exs
* creating testapp/test/support/data_case.ex
* creating testapp/lib/testapp_web/controllers/error_html.ex
* creating testapp/test/testapp_web/controllers/error_html_test.exs
* creating testapp/lib/testapp_web/components/core_components.ex
* creating testapp/lib/testapp_web/controllers/page_controller.ex
* creating testapp/lib/testapp_web/controllers/page_html.ex
* creating testapp/lib/testapp_web/controllers/page_html/home.html.heex
* creating testapp/test/testapp_web/controllers/page_controller_test.exs
* creating testapp/lib/testapp_web/components/layouts/root.html.heex
* creating testapp/lib/testapp_web/components/layouts/app.html.heex
* creating testapp/lib/testapp_web/components/layouts.ex
* creating testapp/priv/static/images/logo.svg
* creating testapp/lib/testapp/mailer.ex
* creating testapp/lib/testapp_web/gettext.ex
* creating testapp/priv/gettext/en/LC_MESSAGES/errors.po
* creating testapp/priv/gettext/errors.pot
* creating testapp/priv/static/robots.txt
* creating testapp/priv/static/favicon.ico
* creating testapp/assets/js/app.js
* creating testapp/assets/vendor/topbar.js
* creating testapp/assets/css/app.css
* creating testapp/assets/tailwind.config.js
* creating testapp/assets/vendor/heroicons/LICENSE.md
* creating testapp/assets/vendor/heroicons/UPGRADE.md
* extracting testapp/assets/vendor/heroicons/optimized
** (File.Error) could not make directory (with -p) "/Users/dmitri/github/testapp/assets/vendor/heroicons/optimized": file already exists
    (elixir 1.17.3) lib/file.ex:346: File.mkdir_p!/1
    lib/phx_new/generator.ex:87: anonymous fn/2 in Phx.New.Generator.copy_from/3
    (elixir 1.17.3) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
    (elixir 1.17.3) lib/enum.ex:1703: Enum."-map/2-lists^map/1-1-"/2
    lib/phx_new/generator.ex:85: anonymous fn/7 in Phx.New.Generator.copy_from/3
    (elixir 1.17.3) lib/enum.ex:2531: Enum."-reduce/3-lists^foldl/2-0-"/3
    lib/phx_new/generator.ex:67: Phx.New.Generator.copy_from/3
    lib/phx_new/single.ex:141: Phx.New.Single.generate/1
zachdaniel commented 4 hours ago

This seems like a bug with pix.new. Please update your phx_new archive and try again. If that doesn't work, try confirming that mix phx.new app works