Skip to content
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

feat: use fs-err in rattler_shell #933

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
1 change: 1 addition & 0 deletions crates/rattler_shell/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ readme.workspace = true
[dependencies]
enum_dispatch = { workspace = true }
indexmap = { workspace = true }
fs-err = { workspace = true }
itertools = { workspace = true }
rattler_conda_types = { path="../rattler_conda_types", version = "0.29.0", default-features = false }
serde_json = { workspace = true, features = ["preserve_order"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/rattler_shell/src/activation.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#![deny(missing_docs)]

//! This crate provides helper functions to activate and deactivate virtual

Check warning on line 3 in crates/rattler_shell/src/activation.rs

View workflow job for this annotation

GitHub Actions / Format, Lint and Test the Python bindings

Diff in /home/runner/work/rattler/rattler/crates/rattler_shell/src/activation.rs

Check warning on line 3 in crates/rattler_shell/src/activation.rs

View workflow job for this annotation

GitHub Actions / Format and Lint

Diff in /home/runner/work/rattler/rattler/crates/rattler_shell/src/activation.rs
//! environments.

use std::{
collections::HashMap,
ffi::OsStr,
fs,
path::{Path, PathBuf},

Check warning on line 9 in crates/rattler_shell/src/activation.rs

View workflow job for this annotation

GitHub Actions / Format, Lint and Test the Python bindings

Diff in /home/runner/work/rattler/rattler/crates/rattler_shell/src/activation.rs

Check warning on line 9 in crates/rattler_shell/src/activation.rs

View workflow job for this annotation

GitHub Actions / Format and Lint

Diff in /home/runner/work/rattler/rattler/crates/rattler_shell/src/activation.rs
process::ExitStatus,
};
use fs_err as fs;

use indexmap::IndexMap;
use rattler_conda_types::Platform;
Expand Down
2 changes: 1 addition & 1 deletion crates/rattler_shell/src/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn run_in_environment(
let file = tempfile::Builder::new()
.suffix(&format!(".{}", shell.extension()))
.tempfile()?;
std::fs::write(file.path(), shell_script.contents()?)?;
fs_err::write(file.path(), shell_script.contents()?)?;

match shell {
ShellEnum::Bash(_) => Ok(Command::new(shell.executable()).arg(file.path()).output()?),
Expand Down
Loading