Skip to content

Commit 1fc77a8

Browse files
nikbhintadeDZakh
andauthored
Remove Language Selection from CLI (#814)
* remove language selection from cli * Fixes after review --------- Co-authored-by: Dmitry Zakharov <dzakh.dev@gmail.com>
1 parent 40da641 commit 1fc77a8

4 files changed

Lines changed: 37 additions & 20 deletions

File tree

codegenerator/cli/src/cli_args/interactive_init/mod.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ use crate::{
1616
use anyhow::{Context, Result};
1717
use inquire::{Select, Text};
1818
use shared_prompts::prompt_template;
19-
use std::str::FromStr;
2019
use strum;
2120
use strum::{Display, EnumIter, IntoEnumIterator};
2221
use validation::{
@@ -140,19 +139,7 @@ pub async fn prompt_missing_init_args(
140139

141140
let language = match init_args.language {
142141
Some(args_language) => args_language,
143-
None => {
144-
let options = Language::iter()
145-
.map(|language| language.to_string())
146-
.collect::<Vec<String>>();
147-
148-
let input_language = Select::new("Which language would you like to use?", options)
149-
.with_starting_cursor(1)
150-
.prompt()
151-
.context("prompting user to select language")?;
152-
153-
Language::from_str(&input_language)
154-
.context("parsing user input for language selection")?
155-
}
142+
None => Language::TypeScript
156143
};
157144

158145
let ecosystem = prompt_ecosystem(init_args.init_commands)

codegenerator/cli/src/executor/init.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ pub async fn run_init_args(init_args: InitArgs, project_paths: &ProjectPaths) ->
4343
template_dirs
4444
.get_and_extract_template(
4545
template,
46-
&init_config.language,
46+
&Language::TypeScript,
4747
&parsed_project_paths.project_root,
4848
)
4949
.context(format!(
50-
"Failed initializing Fuel template {} with language {} at path {:?}",
51-
&template, &init_config.language, &parsed_project_paths.project_root,
50+
"Failed initializing Fuel template {} at path {:?}",
51+
&template, &parsed_project_paths.project_root,
5252
))?;
5353
}
5454
Ecosystem::Evm {
@@ -57,12 +57,12 @@ pub async fn run_init_args(init_args: InitArgs, project_paths: &ProjectPaths) ->
5757
template_dirs
5858
.get_and_extract_template(
5959
template,
60-
&init_config.language,
60+
&Language::TypeScript,
6161
&parsed_project_paths.project_root,
6262
)
6363
.context(format!(
64-
"Failed initializing Evm template {} with language {} at path {:?}",
65-
&template, &init_config.language, &parsed_project_paths.project_root,
64+
"Failed initializing Evm template {} at path {:?}",
65+
&template, &parsed_project_paths.project_root,
6666
))?;
6767
}
6868
Ecosystem::Evm {
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"name": "EnvioIndexer",
3+
"version": "0.1.0",
4+
"sources": [
5+
{
6+
"dir": "src",
7+
"subdirs": true
8+
},
9+
{
10+
"dir": "test",
11+
"subdirs": true
12+
}
13+
],
14+
"package-specs": {
15+
"module": "commonjs",
16+
"in-source": true
17+
},
18+
"jsx": {
19+
"version": 4
20+
},
21+
"suffix": ".res.js",
22+
"bs-dependencies": [
23+
"generated",
24+
"envio",
25+
"rescript-schema"
26+
]
27+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
open RescriptMocha
2+
open Belt
3+
open TestHelpers

0 commit comments

Comments
 (0)