-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
defmodule Mix.Tasks.Juggler.Exec do | ||
use Mix.Task | ||
|
||
@shortdoc "Executes task within a lockfile context" | ||
# @preferred_cli_env :test | ||
|
||
@impl true | ||
def run([juggle_id | [task | args]]) do | ||
Juggler.within( | ||
String.to_atom(juggle_id), | ||
fn -> | ||
# System.put_env("MIX_ENV", "test") | ||
Mix.Task.run(task, args) | ||
end | ||
) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
defmodule Mix.Tasks.Juggler.Init do | ||
use Mix.Task | ||
|
||
@shortdoc "Initializes an empty juggles.exs file" | ||
|
||
@impl true | ||
def run(_args) do | ||
Juggler.init() | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
defmodule Mix.Tasks.Juggler.Update do | ||
use Mix.Task | ||
|
||
@shortdoc "Updates lockfiles from juggles.exs" | ||
|
||
@impl true | ||
def run(args) do | ||
Juggler.juggles() | ||
|> Enum.map(fn {juggle_id, _deps} -> | ||
Juggler.within( | ||
juggle_id, | ||
fn -> | ||
Mix.Task.rerun("deps.update", args) | ||
end | ||
) | ||
end) | ||
end | ||
end |