From f034f9a469ee758ed4e6ccb9741e9f2bc027d071 Mon Sep 17 00:00:00 2001 From: Sheharyar Naseer Date: Mon, 28 Oct 2019 04:26:12 -0500 Subject: [PATCH 1/2] Fix compilation errors --- lib/arc/storage/s3.ex | 2 +- lib/mix/tasks/g.ex | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/arc/storage/s3.ex b/lib/arc/storage/s3.ex index cd15eba..7b24197 100644 --- a/lib/arc/storage/s3.ex +++ b/lib/arc/storage/s3.ex @@ -6,7 +6,7 @@ defmodule Arc.Storage.S3 do destination_dir = definition.storage_dir(version, {file, scope}) s3_bucket = s3_bucket(definition) s3_key = Path.join(destination_dir, file.file_name) - asset_host = asset_host(definition) + _asset_host = asset_host(definition) acl = definition.acl(version, {file, scope}) s3_options = diff --git a/lib/mix/tasks/g.ex b/lib/mix/tasks/g.ex index 1992035..092ff76 100644 --- a/lib/mix/tasks/g.ex +++ b/lib/mix/tasks/g.ex @@ -46,13 +46,13 @@ defmodule Mix.Tasks.Arc do end defp generate_uploader_file(model_name, project_module_name, path) do - model_destination = Path.join(System.cwd(), "#{path}/#{underscore(model_name)}.ex") + model_destination = Path.join(File.cwd(), "#{path}/#{underscore(model_name)}.ex") create_uploader(model_name, project_module_name, model_destination) end defp generate_phx_uploader_file(model_name, project_module_name) do app_name = Mix.Project.config[:app] - model_destination = Path.join(System.cwd(), "/lib/#{app_name}_web/uploaders/#{underscore(model_name)}.ex") + model_destination = Path.join(File.cwd(), "/lib/#{app_name}_web/uploaders/#{underscore(model_name)}.ex") create_uploader(model_name, project_module_name, model_destination) end From c1d29f8a3eda8a5de99e9ff4265246d2b0dc4629 Mon Sep 17 00:00:00 2001 From: Sheharyar Naseer Date: Tue, 29 Oct 2019 20:44:29 +0400 Subject: [PATCH 2/2] Address feedback --- lib/arc/storage/s3.ex | 1 - lib/mix/tasks/g.ex | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/arc/storage/s3.ex b/lib/arc/storage/s3.ex index 7b24197..b7a7492 100644 --- a/lib/arc/storage/s3.ex +++ b/lib/arc/storage/s3.ex @@ -6,7 +6,6 @@ defmodule Arc.Storage.S3 do destination_dir = definition.storage_dir(version, {file, scope}) s3_bucket = s3_bucket(definition) s3_key = Path.join(destination_dir, file.file_name) - _asset_host = asset_host(definition) acl = definition.acl(version, {file, scope}) s3_options = diff --git a/lib/mix/tasks/g.ex b/lib/mix/tasks/g.ex index 092ff76..090dbc0 100644 --- a/lib/mix/tasks/g.ex +++ b/lib/mix/tasks/g.ex @@ -46,13 +46,13 @@ defmodule Mix.Tasks.Arc do end defp generate_uploader_file(model_name, project_module_name, path) do - model_destination = Path.join(File.cwd(), "#{path}/#{underscore(model_name)}.ex") + model_destination = Path.join(File.cwd!(), "#{path}/#{underscore(model_name)}.ex") create_uploader(model_name, project_module_name, model_destination) end defp generate_phx_uploader_file(model_name, project_module_name) do app_name = Mix.Project.config[:app] - model_destination = Path.join(File.cwd(), "/lib/#{app_name}_web/uploaders/#{underscore(model_name)}.ex") + model_destination = Path.join(File.cwd!(), "/lib/#{app_name}_web/uploaders/#{underscore(model_name)}.ex") create_uploader(model_name, project_module_name, model_destination) end