From 2f0bba37bb6a7c3430ec0b0b381bbae23c51ef6d Mon Sep 17 00:00:00 2001 From: Connor Rigby Date: Tue, 4 May 2021 07:31:10 -0600 Subject: [PATCH] Force compile user code to ensure that CA certs can be loaded --- lib/mix/tasks/nerves_hub.ca_certificate.ex | 2 ++ lib/mix/tasks/nerves_hub.deployment.ex | 2 ++ lib/mix/tasks/nerves_hub.device.ex | 2 ++ lib/mix/tasks/nerves_hub.firmware.ex | 2 ++ lib/mix/tasks/nerves_hub.key.ex | 2 ++ lib/mix/tasks/nerves_hub.org.ex | 2 ++ lib/mix/tasks/nerves_hub.product.ex | 2 ++ lib/mix/tasks/nerves_hub.user.ex | 2 ++ 8 files changed, 16 insertions(+) diff --git a/lib/mix/tasks/nerves_hub.ca_certificate.ex b/lib/mix/tasks/nerves_hub.ca_certificate.ex index e4eb55c..30051a0 100644 --- a/lib/mix/tasks/nerves_hub.ca_certificate.ex +++ b/lib/mix/tasks/nerves_hub.ca_certificate.ex @@ -33,6 +33,8 @@ defmodule Mix.Tasks.NervesHub.CaCertificate do ] def run(args) do + # compile the project in case we need CA certs from it + _ = Mix.Task.run("compile") _ = Application.ensure_all_started(:nerves_hub_cli) {opts, args} = OptionParser.parse!(args, strict: @switches) diff --git a/lib/mix/tasks/nerves_hub.deployment.ex b/lib/mix/tasks/nerves_hub.deployment.ex index d238601..874a6ca 100644 --- a/lib/mix/tasks/nerves_hub.deployment.ex +++ b/lib/mix/tasks/nerves_hub.deployment.ex @@ -64,6 +64,8 @@ defmodule Mix.Tasks.NervesHub.Deployment do ] def run(args) do + # compile the project in case we need CA certs from it + _ = Mix.Task.run("compile") _ = Application.ensure_all_started(:nerves_hub_cli) {opts, args} = OptionParser.parse!(args, strict: @switches) diff --git a/lib/mix/tasks/nerves_hub.device.ex b/lib/mix/tasks/nerves_hub.device.ex index 1b76411..57f2502 100644 --- a/lib/mix/tasks/nerves_hub.device.ex +++ b/lib/mix/tasks/nerves_hub.device.ex @@ -183,6 +183,8 @@ defmodule Mix.Tasks.NervesHub.Device do @spec run([String.t()]) :: :ok | no_return() def run(args) do + # compile the project in case we need CA certs from it + _ = Mix.Task.run("compile") _ = Application.ensure_all_started(:nerves_hub_cli) {opts, args} = OptionParser.parse!(args, strict: @switches) diff --git a/lib/mix/tasks/nerves_hub.firmware.ex b/lib/mix/tasks/nerves_hub.firmware.ex index ff4938f..0dd2fbf 100644 --- a/lib/mix/tasks/nerves_hub.firmware.ex +++ b/lib/mix/tasks/nerves_hub.firmware.ex @@ -67,6 +67,8 @@ defmodule Mix.Tasks.NervesHub.Firmware do ] def run(args) do + # compile the project in case we need CA certs from it + _ = Mix.Task.run("compile") _ = Application.ensure_all_started(:nerves_hub_cli) {opts, args} = OptionParser.parse!(args, strict: @switches) diff --git a/lib/mix/tasks/nerves_hub.key.ex b/lib/mix/tasks/nerves_hub.key.ex index 8fb6add..0cf3c53 100644 --- a/lib/mix/tasks/nerves_hub.key.ex +++ b/lib/mix/tasks/nerves_hub.key.ex @@ -91,6 +91,8 @@ defmodule Mix.Tasks.NervesHub.Key do ] def run(args) do + # compile the project in case we need CA certs from it + _ = Mix.Task.run("compile") _ = Application.ensure_all_started(:nerves_hub_cli) {opts, args} = OptionParser.parse!(args, strict: @switches) diff --git a/lib/mix/tasks/nerves_hub.org.ex b/lib/mix/tasks/nerves_hub.org.ex index 3220274..2ea7893 100644 --- a/lib/mix/tasks/nerves_hub.org.ex +++ b/lib/mix/tasks/nerves_hub.org.ex @@ -59,6 +59,8 @@ defmodule Mix.Tasks.NervesHub.Org do ] def run(args) do + # compile the project in case we need CA certs from it + _ = Mix.Task.run("compile") _ = Application.ensure_all_started(:nerves_hub_cli) {opts, args} = OptionParser.parse!(args, strict: @switches) diff --git a/lib/mix/tasks/nerves_hub.product.ex b/lib/mix/tasks/nerves_hub.product.ex index fb8915e..acb1ec5 100644 --- a/lib/mix/tasks/nerves_hub.product.ex +++ b/lib/mix/tasks/nerves_hub.product.ex @@ -92,6 +92,8 @@ defmodule Mix.Tasks.NervesHub.Product do ] def run(args) do + # compile the project in case we need CA certs from it + _ = Mix.Task.run("compile") _ = Application.ensure_all_started(:nerves_hub_cli) {opts, args} = OptionParser.parse!(args, strict: @switches) diff --git a/lib/mix/tasks/nerves_hub.user.ex b/lib/mix/tasks/nerves_hub.user.ex index 53afdd5..fa2c17c 100644 --- a/lib/mix/tasks/nerves_hub.user.ex +++ b/lib/mix/tasks/nerves_hub.user.ex @@ -53,6 +53,8 @@ defmodule Mix.Tasks.NervesHub.User do @switches [path: :string] def run(args) do + # compile the project in case we need CA certs from it + _ = Mix.Task.run("compile") _ = Application.ensure_all_started(:nerves_hub_cli) {opts, args} = OptionParser.parse!(args, strict: @switches)