Skip to content

Commit

Permalink
add envs for rtx ruby core plugin (#682)
Browse files Browse the repository at this point in the history
  • Loading branch information
dfang authored Jul 14, 2023
1 parent 57a7340 commit 53454c8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions src/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,14 @@ pub static NVM_DIR: Lazy<PathBuf> =
pub static NODENV_ROOT: Lazy<PathBuf> =
Lazy::new(|| var_path("NODENV_ROOT").unwrap_or_else(|| HOME.join(".nodenv")));

// ruby
pub static RTX_RUBY_BUILD_REPO: Lazy<String> = Lazy::new(|| {
var("RTX_RUBY_BUILD_REPO").unwrap_or_else(|_| "https://github.com/rbenv/ruby-build.git".into())
});
pub static RTX_RUBY_INSTALL_REPO: Lazy<String> = Lazy::new(|| {
var("RTX_RUBY_INSTALL_REPO")
.unwrap_or_else(|_| "https://github.com/postmodern/ruby-install.git".into())
});
pub static RTX_RUBY_INSTALL: Lazy<bool> = Lazy::new(|| var_is_true("RTX_RUBY_INSTALL"));
pub static RTX_RUBY_APPLY_PATCHES: Lazy<Option<String>> =
Lazy::new(|| var("RTX_RUBY_APPLY_PATCHES").ok());
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/core/ruby.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ impl RubyPlugin {
file::remove_all(&tmp)?;
file::create_dir_all(tmp.parent().unwrap())?;
let git = Git::new(tmp.clone());
git.clone("https://github.com/rbenv/ruby-build.git")?;
git.clone(&env::RTX_RUBY_BUILD_REPO)?;

cmd!("sh", "install.sh")
.env("PREFIX", self.ruby_build_path())
Expand Down Expand Up @@ -108,7 +108,7 @@ impl RubyPlugin {
file::remove_all(&tmp)?;
file::create_dir_all(tmp.parent().unwrap())?;
let git = Git::new(tmp.clone());
git.clone("https://github.com/postmodern/ruby-install")?;
git.clone(&env::RTX_RUBY_INSTALL_REPO)?;

cmd!("make", "install")
.env("PREFIX", self.ruby_install_path())
Expand Down

0 comments on commit 53454c8

Please sign in to comment.