Skip to content

Commit

Permalink
Changed install of dependencies to use elm-json, fixes ellie-app#121
Browse files Browse the repository at this point in the history
  • Loading branch information
pdamoc committed Dec 5, 2019
1 parent 9b83b30 commit 0d74c0c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/elm/platform/local_19.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ defmodule Elm.Platform.Local19 do
alias Elm.Version
require Logger

@elm_json_binary System.cmd("which", ["elm-json"]) |> elem(0) |> String.trim()

@spec setup(Path.t()) :: {:ok, Project.t()} | :error
def setup(root) do
with :ok <- elm_init(root) do
Expand Down Expand Up @@ -121,13 +123,13 @@ defmodule Elm.Platform.Local19 do
:ok

[head | tail] ->
binary = Path.join(base_path(), "elm")
package = "#{head.name.user}/#{head.name.project}"
args = ["install", package]
package = "#{head.name.user}/#{head.name.project}@#{Elm.Version.to_string(head.version)}"

args = ["install", "--yes", package]
options = [out: :string, err: :string, dir: root, in: "Y"]

result =
case Porcelain.exec(binary, args, options) do
case Porcelain.exec(@elm_json_binary, args, options) do
%Porcelain.Result{status: 0} ->
install_missing_deps(root, tail)

Expand Down

0 comments on commit 0d74c0c

Please sign in to comment.