Skip to content

Commit 522183a

Browse files
committed
Remove the 'env' command, as we have the variable
1 parent b093d5d commit 522183a

File tree

5 files changed

+1
-102
lines changed

5 files changed

+1
-102
lines changed

crates/nu-command/src/default_context.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ pub fn create_default_context() -> EngineState {
343343

344344
// Env
345345
bind_command! {
346-
Env,
347346
ExportEnv,
348347
LetEnv,
349348
LoadEnv,

crates/nu-command/src/env/env_command.rs

Lines changed: 0 additions & 90 deletions
This file was deleted.

crates/nu-command/src/env/mod.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
mod config;
2-
mod env_command;
32
mod export_env;
43
mod let_env;
54
mod load_env;
@@ -10,7 +9,6 @@ pub use config::ConfigEnv;
109
pub use config::ConfigMeta;
1110
pub use config::ConfigNu;
1211
pub use config::ConfigReset;
13-
pub use env_command::Env;
1412
pub use export_env::ExportEnv;
1513
pub use let_env::LetEnv;
1614
pub use load_env::LoadEnv;

src/tests/test_env.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,3 @@ fn shorthand_env_2() -> TestResult {
1414
fn shorthand_env_3() -> TestResult {
1515
run_test(r#"FOO=BAZ BAR=MOO $env.FOO"#, "BAZ")
1616
}
17-
18-
#[test]
19-
fn convert_non_string_env_var_to_nothing() -> TestResult {
20-
run_test(
21-
r#"let-env FOO = true; env | where name == FOO | get raw.0 | describe"#,
22-
"nothing",
23-
)
24-
}

src/tests/test_parser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ fn equals_separates_long_flag() -> TestResult {
234234
fn let_env_expressions() -> TestResult {
235235
let env = HashMap::from([("VENV_OLD_PATH", "Foobar"), ("Path", "Quux")]);
236236
run_test_with_env(
237-
r#"let-env Path = if (env | any {|x| $x.name == VENV_OLD_PATH}) { $env.VENV_OLD_PATH } else { $env.Path }; echo $env.Path"#,
237+
r#"let-env Path = if ($env | columns | "VENV_OLD_PATH" in $in) { $env.VENV_OLD_PATH } else { $env.Path }; echo $env.Path"#,
238238
"Foobar",
239239
&env,
240240
)

0 commit comments

Comments
 (0)