             File.mkdir_p!(Path.dirname(filename))
             File.write!(filename, script)
             set_perms(filename)
+
           {:error, error} ->
-            Mix.raise "Error creating escript: #{error}"
-        end
-
-        Mix.shell.info "Generated escript #{filename} with MIX_ENV=#{Mix.env}"
+            Mix.raise("Error creating escript: #{error}")
+        end
+
+        Mix.shell().info("Generated escript #{filename} with MIX_ENV=#{Mix.env()}")
         :ok
+
       true ->
         :noop
     end
   end
 
   defp project_files() do
-    get_files(Mix.Project.app_path)
+    get_files(Mix.Project.app_path())
   end
 
   defp get_files(app) do

      end

  """
  @switches [force: :boolean, compile: :boolean,
             deps_check: :boolean, archives_check: :boolean, elixir_version_check: :boolean]

  def run(args) do
    Mix.Project.get!
    {opts, _} = OptionParser.parse!(args, strict: @switches)

    if Keyword.get(opts, :compile, true) do
      Mix.Task.run :compile, args
    end

    project  = Mix.Project.config
    language = Keyword.get(project, :language, :elixir)

    escriptize(project, language, Keyword.get(opts, :force, false))

  defp gen_main(project, name, module, app, language) do
    config =
      if File.regular?(project[:config_path]) do
        Macro.escape(Mix.Config.read!(project[:config_path]))
      else
        []
      end

    module_body =
      quote do
        @module unquote(module)
        @config unquote(config)
        @app unquote(app)

        @spec main(OptionParser.argv()) :: any
        def main(args) do
          unquote(main_body_for(language))
        end

        defp load_config(config) do
          each_fun = fn {app, kw} ->
            set_env_fun = fn {k, v} -> :application.set_env(app, k, v, persistent: true) end
            :lists.foreach(set_env_fun, kw)
          end
          
          :lists.foreach(each_fun, config)

          :ok
        end

        defp start_app(nil) do
          :ok
        end

        defp start_app(app) do
          case :application.ensure_all_started(app) do
            {:ok, _} ->
              :ok

            {:error, {app, reason}} ->
              formatted_error =
                case :code.ensure_loaded(Application) do
                  {:module, Application} -> Application.format_error(reason)
                  {:error, _} -> :io_lib.format('~p', [reason])
                end

              error_message = [
                "Could not start application ",
                :erlang.atom_to_binary(app, :utf8),
                ": ",
                formatted_error,
                ?\n
              ]

              io_error(error_message)

              :erlang.halt(1)
          end
        end

        defp io_error(message) do
          :io.put_chars(:standard_error, message)
        end
      end

    {:module, ^name, binary, _} = Module.create(name, module_body, Macro.Env.location(__ENV__))
    [{'#{name}.beam', binary}]
