       end
 
     quote do
+      name = unquote(name)
+      plugin_opts = unquote(opts)
       current_env = var!(current_env, Mix.Releases.Config)
       current_rel = var!(current_rel, Mix.Releases.Config)
 

  def read!(file) do
    read_string!(File.read!(file))
  rescue
    e in [LoadError] -> reraise(LoadError, [file: file, error: e.error], System.stacktrace())
    e -> reraise(LoadError, [file: file, error: e], System.stacktrace())
  end

  @doc """

        raise "cannot use set/1 outside of an environment or a release!"
      end

      set_opts = unquote(opts)

      conf = var!(config, Mix.Releases.Config)

      new_conf =
        cond do
          current_env != nil ->
            env = get_in(conf, [:environments, current_env])

            env =
              Enum.reduce(set_opts, env, fn {k, v}, acc ->
                case Map.has_key?(acc.profile, k) do
                  false ->
                    raise "unknown environment config setting `#{k}`"

                  true ->
                    %{acc | :profile => Map.put(acc.profile, k, v)}
                end
              end)

            put_in(conf, [:environments, current_env], env)

          current_rel != nil ->
            rel = get_in(conf, [:releases, current_rel])

            rel =
              Enum.reduce(set_opts, rel, fn
                {:version, v}, acc ->
                  %{acc | :version => v}

                {:applications, v}, acc ->
                  %{acc | :applications => acc.applications ++ v}

                {k, v}, acc ->
                  case Map.has_key?(acc.profile, k) do
                    false ->
                      raise "unknown release config setting `#{k}`"

                    true ->
                      %{acc | :profile => Map.put(acc.profile, k, v)}
                  end
              end)

            put_in(conf, [:releases, current_rel], rel)
        end

      var!(config, Mix.Releases.Config) = new_conf
    end
  end

