sinisijacob

sinisijacob

Running another mix task from Igniter

Let me start by saying i am very new to elixir in general and have just started messing around with Igniter.

I am trying to make an igniter task that runs another mix task, and I am running in to problems that I can’t figure my way out of after reading through some of the igniter docs/code. This is my igniter task:

  use Igniter.Mix.Task

  @shortdoc "makes a new project with user auth"

  def igniter(igniter, _argv) do
    igniter
      |> Igniter.add_task("phx.gen.auth", ["Accounts", "User", "users"])
  end
end

I am running it using:

mix igniter_example.gen.user_auth

And I am getting this error on running:

Compiling 1 file (.ex)
** (FunctionClauseError) no function clause matching in Application.ensure_all_started/2    
    
    The following arguments were given to Application.ensure_all_started/2:
    
        # 1
        [:rewrite]
    
        # 2
        :temporary
    
    Attempted function clauses (showing 1 out of 1):
    
        def ensure_all_started(app, type) when is_atom(app)
    
    (elixir 1.14.5) lib/application.ex:848: Application.ensure_all_started/2
    (igniter_example 0.1.0) lib/mix/tasks/igniter_example.gen.user_auth.ex:2: Mix.Tasks.IgniterExample.Gen.UserAuth.run/1
    (mix 1.14.5) lib/mix/task.ex:421: anonymous fn/3 in Mix.Task.run_task/4
    (mix 1.14.5) lib/mix/cli.ex:84: Mix.CLI.run_task/2

Any help getting past this hurdle would be greatly appreciated.

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
gshaw
What is the idiomatic way of matching for not nil in Elixir? E.g., First way: defp halt_if_not_signed_in(conn, signed_in_account) when...
New
_russellb
I want to try my hand at web scraping. What tools/libraries do I need to use. I’m hoping to turn this into something professional so don’...
New
ycv005
I have followed this StackOverflow post to install the specific version of Erlang. And When I am running mix ecto.setup then getting fol...
New
polypush135
As many of you may have realized by now (sorry for all the posts here) I’ve been working on a db problem where I’m trying to aggregate a ...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
Exadra37
Sometimes I want to check if the input into a function is not a blank string. My first approach: defmodule Example do def do_stuff(s...
New
Mooodi
Given a string, how can I get access to its character by index? Enum.at("my_string", 2) doesn't work. Or rather, not char, but a substr...
New

Other popular topics Top

yurko
Here are few pieces of (common) Linux knowledge that we use for reasonably small one server apps. We use Ubuntu but this should work for ...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
lk-geimfari
What is most correct way to open, read and parse JSON file with poison? For example if we have example.json file in root of some projec...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
freewebwithme
Using vs code and installed ElixirLS: support and debugger. And I got an error popped up on start up says Failed to run ‘elixir’ comma...
New
myronmarston
The Elixir Typespec docs show the following syntax for keyword lists in typespecs: # ... | [key: type] # keyword lis...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement