Current section

6 Versions

Jump to

Compare versions

10 files changed
+82 additions
-72 deletions
  @@ -7,6 +7,7 @@ A process manager for your `Procfile`(s).
7 7 Install the Honcho archive into your Elixir:
8 8
9 9 ```shell
10 + mix archive.install hex honcho_supervisor
10 11 mix archive.install hex honcho
11 12 ```
  @@ -5,17 +5,17 @@
5 5 {<<"files">>,
6 6 [<<"lib">>,<<"lib/honcho.ex">>,<<"lib/mix">>,<<"lib/mix/tasks">>,
7 7 <<"lib/mix/tasks/honcho">>,<<"lib/mix/tasks/honcho/start.ex">>,
8 - <<"lib/mix/tasks/honcho/info.ex">>,<<"lib/mix/tasks/git">>,
9 - <<"lib/mix/tasks/git/tags">>,<<"lib/mix/tasks/git/tags/create.ex">>,
10 - <<"lib/mix/tasks/git/tags/push.ex">>,<<"lib/honcho">>,
11 - <<"lib/honcho/error.ex">>,<<"lib/honcho/color.ex">>,
12 - <<"lib/honcho/command.ex">>,<<"lib/honcho/subcommand.ex">>,
13 - <<"lib/honcho/output.ex">>,<<"lib/honcho/subcommand">>,
14 - <<"lib/honcho/subcommand/start.ex">>,<<"lib/honcho/subcommand/help.ex">>,
15 - <<"lib/honcho/subcommand/info.ex">>,<<"lib/honcho/command">>,
16 - <<"lib/honcho/command/init.ex">>,<<"lib/honcho/command/helpers.ex">>,
17 - <<"lib/honcho/procfile.ex">>,<<"lib/honcho/args.ex">>,<<".formatter.exs">>,
18 - <<"mix.exs">>,<<"README.md">>]}.
8 + <<"lib/mix/tasks/honcho/tags">>,<<"lib/mix/tasks/honcho/tags/create.ex">>,
9 + <<"lib/mix/tasks/honcho/tags/push.ex">>,<<"lib/mix/tasks/honcho/info.ex">>,
10 + <<"lib/mix/tasks/git">>,<<"lib/honcho">>,<<"lib/honcho/error.ex">>,
11 + <<"lib/honcho/color.ex">>,<<"lib/honcho/command.ex">>,
12 + <<"lib/honcho/subcommand.ex">>,<<"lib/honcho/output.ex">>,
13 + <<"lib/honcho/subcommand">>,<<"lib/honcho/subcommand/start.ex">>,
14 + <<"lib/honcho/subcommand/help.ex">>,<<"lib/honcho/subcommand/info.ex">>,
15 + <<"lib/honcho/command">>,<<"lib/honcho/command/init.ex">>,
16 + <<"lib/honcho/command/helpers.ex">>,<<"lib/honcho/procfile.ex">>,
17 + <<"lib/honcho/args.ex">>,<<".formatter.exs">>,<<"mix.exs">>,
18 + <<"README.md">>]}.
19 19 {<<"licenses">>,[<<"MIT">>]}.
20 20 {<<"links">>,[{<<"github">>,<<"https://github.com/livinginthepast/honcho">>}]}.
21 21 {<<"name">>,<<"honcho">>}.
  @@ -24,5 +24,5 @@
24 24 {<<"name">>,<<"honcho_supervisor">>},
25 25 {<<"optional">>,false},
26 26 {<<"repository">>,<<"hexpm">>},
27 - {<<"requirement">>,<<"0.2.1">>}]]}.
28 - {<<"version">>,<<"0.2.1">>}.
27 + {<<"requirement">>,<<"0.2.2">>}]]}.
28 + {<<"version">>,<<"0.2.2">>}.
  @@ -2,6 +2,7 @@ defmodule Honcho.Command do
2 2 @moduledoc false
3 3 use GenServer
4 4
5 + import Honcho.Output, only: [now: 0]
5 6 alias Honcho.Command.Helpers
6 7 alias Honcho.Output
7 8
  @@ -81,8 +82,6 @@ defmodule Honcho.Command do
81 82
82 83 defp warn(state, msg),
83 84 do: Output.warn("#{now()} [Command:#{state.name}] #{msg}") && state
84 -
85 - defp now(), do: DateTime.utc_now() |> DateTime.to_iso8601()
86 85 end
87 86
88 87 defimpl String.Chars, for: Honcho.Command do
  @@ -34,6 +34,8 @@ defmodule Honcho.Output do
34 34 @doc "Writes a warning message"
35 35 def warn(string), do: puts(string, :warn)
36 36
37 + def now(), do: DateTime.utc_now() |> DateTime.to_iso8601()
38 +
37 39 @doc "Writes an info message"
38 40 def puts(), do: IO.puts("")
39 41 def puts(string), do: puts(string, :info)
  @@ -3,6 +3,10 @@ defmodule Honcho.Subcommand.Start do
3 3 Starts the processes in a given Procfile.
4 4 """
5 5
6 + @version Mix.Project.config()[:version]
7 +
8 + import Honcho.Output, only: [now: 0]
9 +
6 10 @behaviour Honcho.Subcommand
7 11 @default_args [procfile: "Procfile"]
8 12
  @@ -22,6 +26,8 @@ defmodule Honcho.Subcommand.Start do
22 26 do: Application.put_env(:honcho, :commands, commands) |> run()
23 27
24 28 def run(:ok) do
29 + Honcho.Output.warn("#{now()} [Honcho v#{version()}] ...")
30 +
25 31 with {:ok, _app} <- Application.ensure_all_started(:honcho_supervisor, :permanent) do
26 32 :timer.sleep(:infinity)
27 33 else
  @@ -30,4 +36,6 @@ defmodule Honcho.Subcommand.Start do
30 36 end
31 37
32 38 def run({:error, _} = error), do: Honcho.Error.parse(error)
39 +
40 + defp version(), do: @version
33 41 end
Loading more files…