-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from DeterminateSystems/elixir-init
Add Elixir detection
- Loading branch information
Showing
4 changed files
with
29 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
use crate::cli::cmd::init::{project::Project, prompt::Prompt}; | ||
|
||
use super::{Flake, Handler}; | ||
|
||
const ELIXIR_LATEST: &str = "elixir_1_15"; | ||
const ERLANG_LATEST: &str = "erlang_26"; | ||
|
||
pub(crate) struct Elixir; | ||
|
||
impl Handler for Elixir { | ||
fn handle(project: &Project, flake: &mut Flake) { | ||
if project.has_file("mix.exs") && Prompt::for_language("Elixir") { | ||
flake.dev_shell_packages.push(String::from(ELIXIR_LATEST)); | ||
flake.dev_shell_packages.push(String::from("elixir_ls")); | ||
flake.dev_shell_packages.push(String::from(ERLANG_LATEST)); | ||
|
||
if Prompt::bool("Would you like to add Livebook to the environment?") { | ||
flake.dev_shell_packages.push(String::from("livebook")); | ||
} | ||
} | ||
} | ||
} |
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
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