-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue_raised_when_creating_a_react_project #31
base: main
Are you sure you want to change the base?
Conversation
match create_react_app(dir.dir_name.clone()) { | ||
ScaffoldSubCommand::React(dir) => { | ||
let result = match collect_arguement_from_the_terminal().trim() { | ||
"j" => create_react_app(dir.dir_name.clone()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The create_react_app()
function returns a Result enum, you will have to have each variant
ScaffoldSubCommand::React(dir) => { | ||
let result = match collect_arguement_from_the_terminal().trim() { | ||
"j" => create_react_app(dir.dir_name.clone()), | ||
"t" => create_react_app_with_typescript(dir.dir_name.clone()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly the create_react_app_with_typescript()
returns a Result enum, handle all variants.
@@ -248,6 +243,18 @@ pub fn resolve(args: ClapperArgs) -> Result<(), Box<dyn Error>> { | |||
Ok(()) | |||
} | |||
|
|||
fn collect_arguement_from_the_terminal() -> String { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already an existing pattern of getting command line inputs, don't reinvent the wheel.
i implemented a support so as to reduce the verbosity when creating a react project...