From d67fd7ebb774f065d62dcffd6d7b87f7e0d77f30 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 13 Feb 2022 11:50:35 -0500 Subject: [PATCH] Add dev shim to upload task for local testing --- lib/mix/tasks/upload_to_s3.ex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/mix/tasks/upload_to_s3.ex b/lib/mix/tasks/upload_to_s3.ex index 166be286..cb250c6b 100644 --- a/lib/mix/tasks/upload_to_s3.ex +++ b/lib/mix/tasks/upload_to_s3.ex @@ -21,6 +21,14 @@ defmodule Mix.Tasks.UploadToS3 do def run([concurrency | args]) do {concurrency, _} = Integer.parse(concurrency) + if Enum.member?(args, "--dev") do + Application.put_env(:philomena, :advert_file_root, "priv/static/system/images/adverts") + Application.put_env(:philomena, :avatar_file_root, "priv/static/system/images/avatars") + Application.put_env(:philomena, :badge_file_root, "priv/static/system/images") + Application.put_env(:philomena, :image_file_root, "priv/static/system/images") + Application.put_env(:philomena, :tag_file_root, "priv/static/system/images") + end + if Enum.member?(args, "--adverts") do file_root = Application.fetch_env!(:philomena, :advert_file_root) new_file_root = System.get_env("NEW_ADVERT_FILE_ROOT", "adverts")