Skip to content

Commit 4f2bec5

Browse files
committed
Remove unused functions
1 parent 2b9b82b commit 4f2bec5

File tree

2 files changed

+2
-37
lines changed

2 files changed

+2
-37
lines changed

crates/pixi_trampoline/src/main.rs

-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ pub const TRAMPOLINE_CONFIGURATION: &str = "trampoline_configuration";
1616
#[derive(Deserialize, Debug)]
1717
struct Metadata {
1818
exe: String,
19-
#[allow(unused)]
20-
path: String,
2119
env: HashMap<String, String>,
2220
}
2321

src/global/install.rs

+2-35
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ use crate::{
77
prefix::Executable,
88
prefix::Prefix,
99
};
10-
use indexmap::{IndexMap, IndexSet};
10+
use indexmap::IndexSet;
1111
use itertools::Itertools;
1212
use miette::IntoDiagnostic;
1313
use pixi_utils::executable_from_path;
1414
use rattler_conda_types::{
1515
MatchSpec, Matches, PackageName, ParseStrictness, Platform, RepoDataRecord,
1616
};
17-
use std::{collections::HashMap, path::PathBuf, str::FromStr};
17+
use std::{path::PathBuf, str::FromStr};
1818

1919
use fs_err::tokio as tokio_fs;
2020

@@ -163,39 +163,6 @@ pub(crate) async fn create_executable_trampolines(
163163
Ok(state_changes)
164164
}
165165

166-
/// Warn user on dangerous package installations, interactive yes no prompt
167-
#[allow(unused)]
168-
pub(crate) fn prompt_user_to_continue(
169-
packages: &IndexMap<PackageName, MatchSpec>,
170-
) -> miette::Result<bool> {
171-
let dangerous_packages = HashMap::from([
172-
("pixi", "Installing `pixi` globally doesn't work as expected.\nUse `pixi self-update` to update pixi and `pixi self-update --version x.y.z` for a specific version."),
173-
("pip", "Installing `pip` with `pixi global` won't make pip-installed packages globally available.\nInstead, use a pixi project and add PyPI packages with `pixi add --pypi`, which is recommended. Alternatively, `pixi add pip` and use it within the project.")
174-
]);
175-
176-
// Check if any of the packages are dangerous, and prompt the user to ask if
177-
// they want to continue, including the advice.
178-
for (name, _spec) in packages {
179-
if let Some(advice) = dangerous_packages.get(&name.as_normalized()) {
180-
let prompt = format!(
181-
"{}\nDo you want to continue?",
182-
console::style(advice).yellow()
183-
);
184-
if !dialoguer::Confirm::new()
185-
.with_prompt(prompt)
186-
.default(false)
187-
.show_default(true)
188-
.interact()
189-
.into_diagnostic()?
190-
{
191-
return Ok(false);
192-
}
193-
}
194-
}
195-
196-
Ok(true)
197-
}
198-
199166
/// Checks if the local environment matches the given specifications.
200167
///
201168
/// This function verifies that all the given specifications are present in the

0 commit comments

Comments
 (0)