Skip to content

Commit

Permalink
Make the ruby_version and rails_version fields of the Cli struct non-…
Browse files Browse the repository at this point in the history
…optional.

This is because the default values are already set in the struct definition.
  • Loading branch information
rafaelfranca committed Mar 19, 2024
1 parent 4826c31 commit 2717f49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ fn main() {
// read the content of the DOCKERFILE and store it in a variable
let dockerfile = include_bytes!("../Dockerfile");

let ruby_version = cli.ruby_version.unwrap();
let rails_version = cli.rails_version.unwrap();
let ruby_version = cli.ruby_version;
let rails_version = cli.rails_version;

// Run docker build --build-arg RUBY_VERSION=$RUBY_VERSION --build-arg RAILS_VERSION=$RAILS_VERSION -t rails-new-$RUBY_VERSION-$RAILS_VERSION
// passing the content of DOCKERFILE to the command stdin
Expand Down
4 changes: 2 additions & 2 deletions src/rails_new.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ pub struct Cli {
/// arguments passed to `rails new`
pub args: Vec<String>,
#[clap(long, short = 'u', default_value = "3.2.3")]
pub ruby_version: Option<String>,
pub ruby_version: String,
#[clap(long, short = 'r', default_value = "7.1.3")]
pub rails_version: Option<String>,
pub rails_version: String,
}

#[test]
Expand Down

0 comments on commit 2717f49

Please sign in to comment.