diff --git a/lib/mix/tasks/music_library/prod/db_migrate.ex b/lib/mix/tasks/music_library/prod/db_migrate.ex index f9e993eb..185e612f 100644 --- a/lib/mix/tasks/music_library/prod/db_migrate.ex +++ b/lib/mix/tasks/music_library/prod/db_migrate.ex @@ -11,7 +11,7 @@ defmodule Mix.Tasks.MusicLibrary.Prod.DbMigrate do @impl Mix.Task def run(_args) do - IO.puts("Running migrations on production database") + Mix.Shell.IO.info("Running migrations on production database") fly_ssh("bin/migrate") end diff --git a/lib/mix/tasks/music_library/prod/db_pull.ex b/lib/mix/tasks/music_library/prod/db_pull.ex index 07cc2ed3..aaaebed9 100644 --- a/lib/mix/tasks/music_library/prod/db_pull.ex +++ b/lib/mix/tasks/music_library/prod/db_pull.ex @@ -10,7 +10,7 @@ defmodule Mix.Tasks.MusicLibrary.Prod.DbPull do @impl Mix.Task def run(_args) do - IO.puts("Pulling the latest database from the production server") + Mix.Shell.IO.info("Pulling the latest database from the production server") current_time = DateTime.utc_now() remote_db = "/mnt/music_library/music_library_prod.db" @@ -18,13 +18,13 @@ defmodule Mix.Tasks.MusicLibrary.Prod.DbPull do case fly_sftp_get(remote_db, local_db) do {_stream, 1} -> - IO.puts("Failed to pull the database") + Mix.Shell.IO.error("Failed to pull the database") System.halt(1) {_stream, 0} -> - IO.puts("Database pulled successfully") + Mix.Shell.IO.info("Database pulled successfully") - IO.puts("Restoring as local dev database") + Mix.Shell.IO.info("Restoring as local dev database") Path.wildcard("data/music_library_dev.db*") |> Enum.each(&File.rm!/1) diff --git a/lib/mix/tasks/music_library/prod/db_vacuum.ex b/lib/mix/tasks/music_library/prod/db_vacuum.ex index d6996548..c68b3d86 100644 --- a/lib/mix/tasks/music_library/prod/db_vacuum.ex +++ b/lib/mix/tasks/music_library/prod/db_vacuum.ex @@ -12,7 +12,7 @@ defmodule Mix.Tasks.MusicLibrary.Prod.DbVacuum do @impl Mix.Task def run(_args) do - IO.puts("Running VACUUM on the production database") + Mix.Shell.IO.info("Running VACUUM on the production database") command = ~s(bin/music_library rpc 'MusicLibrary.Repo.query\("VACUUM"\)') diff --git a/lib/mix/tasks/music_library/prod/helpers.ex b/lib/mix/tasks/music_library/prod/helpers.ex index a6396011..1bd686a6 100644 --- a/lib/mix/tasks/music_library/prod/helpers.ex +++ b/lib/mix/tasks/music_library/prod/helpers.ex @@ -3,7 +3,7 @@ defmodule Mix.Tasks.MusicLibrary.Prod.Helpers do if flyctl_installed?() do System.cmd("flyctl", ["ssh", "console", "--command", command], into: IO.stream()) else - IO.puts("Please install flyctl first") + Mix.Shell.IO.error("Please install flyctl first") System.halt(1) end end @@ -12,7 +12,7 @@ defmodule Mix.Tasks.MusicLibrary.Prod.Helpers do if flyctl_installed?() do System.cmd("flyctl", ["ssh", "sftp", "get", remote_path, local_path], into: IO.stream()) else - IO.puts("Please install flyctl first") + Mix.Shell.IO.error("Please install flyctl first") System.halt(1) end end