Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/rattler/src/install/link_script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub fn run_link_scripts<'a>(
let shell = if platform.is_windows() {
ShellEnum::CmdExe(CmdExe)
} else {
ShellEnum::Bash(Bash)
ShellEnum::Bash(Bash::default())
};

tracing::info!(
Expand Down
7 changes: 5 additions & 2 deletions crates/rattler_menuinst/src/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,11 @@ impl LinuxMenu {
.unwrap_or(true)
.then(|| {
// create a bash activation script and emit it into the script
let activator =
Activator::from_path(&self.prefix, shell::Bash, Platform::current())?;
let activator = Activator::from_path(
&self.prefix,
shell::Bash::default(),
Platform::current(),
)?;
let activation_variables = ActivationVariables {
path_modification_behavior: PathModificationBehavior::Prepend,
..Default::default()
Expand Down
3 changes: 2 additions & 1 deletion crates/rattler_menuinst/src/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,8 @@ impl MacOSMenu {
// Run a cached activation
if self.command.activate.unwrap_or(false) {
// create a bash activation script and emit it into the script
let activator = Activator::from_path(&self.prefix, shell::Bash, Platform::current())?;
let activator =
Activator::from_path(&self.prefix, shell::Bash::default(), Platform::current())?;
let activation_variables = ActivationVariables {
path_modification_behavior: PathModificationBehavior::Prepend,
..Default::default()
Expand Down
28 changes: 17 additions & 11 deletions crates/rattler_shell/src/activation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ impl<T: Shell + Clone> Activator<T> {
/// use rattler_conda_types::Platform;
/// use std::path::PathBuf;
///
/// let activator = Activator::from_path(&PathBuf::from("tests/fixtures/env_vars"), shell::Bash, Platform::Osx64).unwrap();
/// let activator = Activator::from_path(&PathBuf::from("tests/fixtures/env_vars"), shell::Bash::default(), Platform::Osx64).unwrap();
/// assert_eq!(activator.paths.len(), 1);
/// assert_eq!(activator.paths[0], PathBuf::from("tests/fixtures/env_vars/bin"));
/// ```
Expand Down Expand Up @@ -722,7 +722,7 @@ mod tests {

let activator = Activator {
target_prefix: temp_dir.path().to_path_buf(),
shell_type: shell::Bash,
shell_type: shell::Bash::default(),
paths: vec![temp_dir.path().join("bin")],
activation_scripts: vec![script_path.clone()],
deactivation_scripts: vec![],
Expand Down Expand Up @@ -785,7 +785,7 @@ mod tests {
fs::write(&script2, "").unwrap();
fs::write(&script3, "").unwrap();

let shell_type = shell::Bash;
let shell_type = shell::Bash::default();

let scripts = collect_scripts(&path, &shell_type).unwrap();
assert_eq!(scripts.len(), 3);
Expand Down Expand Up @@ -967,11 +967,11 @@ mod tests {
#[test]
#[cfg(unix)]
fn test_activation_script_bash() {
let script = get_script(shell::Bash, PathModificationBehavior::Append);
let script = get_script(shell::Bash::default(), PathModificationBehavior::Append);
insta::assert_snapshot!("test_activation_script_bash_append", script);
let script = get_script(shell::Bash, PathModificationBehavior::Replace);
let script = get_script(shell::Bash::default(), PathModificationBehavior::Replace);
insta::assert_snapshot!("test_activation_script_bash_replace", script);
let script = get_script(shell::Bash, PathModificationBehavior::Prepend);
let script = get_script(shell::Bash::default(), PathModificationBehavior::Prepend);
insta::assert_snapshot!("test_activation_script_bash_prepend", script);
}

Expand Down Expand Up @@ -1117,7 +1117,7 @@ mod tests {
#[test]
#[cfg(unix)]
fn test_run_activation_bash() {
test_run_activation(crate::shell::Bash.into(), false);
test_run_activation(crate::shell::Bash::default().into(), false);
}

#[test]
Expand Down Expand Up @@ -1152,7 +1152,13 @@ mod tests {

// Test all shell types
let shell_types = vec![
("bash", ShellEnum::Bash(shell::Bash)),
("bash", ShellEnum::Bash(shell::Bash::default())),
(
"dash",
ShellEnum::Bash(shell::Bash {
flavor: shell::BashFlavor::Dash,
}),
),
("zsh", ShellEnum::Zsh(shell::Zsh)),
("fish", ShellEnum::Fish(shell::Fish)),
("xonsh", ShellEnum::Xonsh(shell::Xonsh)),
Expand Down Expand Up @@ -1209,7 +1215,7 @@ mod tests {

// Test all shell types
let shell_types = vec![
("bash", ShellEnum::Bash(shell::Bash)),
("bash", ShellEnum::Bash(shell::Bash::default())),
("zsh", ShellEnum::Zsh(shell::Zsh)),
("fish", ShellEnum::Fish(shell::Fish)),
("xonsh", ShellEnum::Xonsh(shell::Xonsh)),
Expand Down Expand Up @@ -1274,7 +1280,7 @@ mod tests {

// Test all shell types
let shell_types = vec![
("bash", ShellEnum::Bash(shell::Bash)),
("bash", ShellEnum::Bash(shell::Bash::default())),
("zsh", ShellEnum::Zsh(shell::Zsh)),
("fish", ShellEnum::Fish(shell::Fish)),
("xonsh", ShellEnum::Xonsh(shell::Xonsh)),
Expand Down Expand Up @@ -1397,7 +1403,7 @@ mod tests {

// Test all shell types
let shell_types = vec![
("bash", ShellEnum::Bash(shell::Bash)),
("bash", ShellEnum::Bash(shell::Bash::default())),
("zsh", ShellEnum::Zsh(shell::Zsh)),
("fish", ShellEnum::Fish(shell::Fish)),
("xonsh", ShellEnum::Xonsh(shell::Xonsh)),
Expand Down
Loading
Loading