deprecate def-env
and export def-env
(#10715)
follow-up to - https://github.com/nushell/nushell/pull/10566 # Description this PR deprecates the use of `def-env` and `export def-env` these two core commands will be removed in 0.88 # User-Facing Changes using `def-env` will give a warning ```nushell > def-env foo [] { print "foo" }; foo Error: × Deprecated command ╭─[entry #1:1:1] 1 │ def-env foo [] { print "foo" }; foo · ───┬─── · ╰── `def-env` is deprecated and will be removed in 0.88. ╰──── help: Use `def --env` instead foo ``` # Tests + Formatting # After Submitting
This commit is contained in:
parent
b58819d51e
commit
1662e61ecb
|
@ -37,11 +37,21 @@ impl Command for DefEnv {
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
engine_state: &EngineState,
|
||||||
_stack: &mut Stack,
|
_stack: &mut Stack,
|
||||||
_call: &Call,
|
call: &Call,
|
||||||
_input: PipelineData,
|
_input: PipelineData,
|
||||||
) -> Result<PipelineData, ShellError> {
|
) -> Result<PipelineData, ShellError> {
|
||||||
|
nu_protocol::report_error_new(
|
||||||
|
engine_state,
|
||||||
|
&ShellError::GenericError(
|
||||||
|
"Deprecated command".into(),
|
||||||
|
"`def-env` is deprecated and will be removed in 0.88.".into(),
|
||||||
|
Some(call.head),
|
||||||
|
Some("Use `def --env` instead".into()),
|
||||||
|
vec![],
|
||||||
|
),
|
||||||
|
);
|
||||||
Ok(PipelineData::empty())
|
Ok(PipelineData::empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,11 +62,21 @@ export def-env cd_with_fallback [arg = ""] {
|
||||||
|
|
||||||
fn run(
|
fn run(
|
||||||
&self,
|
&self,
|
||||||
_engine_state: &EngineState,
|
engine_state: &EngineState,
|
||||||
_stack: &mut Stack,
|
_stack: &mut Stack,
|
||||||
_call: &Call,
|
call: &Call,
|
||||||
_input: PipelineData,
|
_input: PipelineData,
|
||||||
) -> Result<PipelineData, ShellError> {
|
) -> Result<PipelineData, ShellError> {
|
||||||
|
nu_protocol::report_error_new(
|
||||||
|
engine_state,
|
||||||
|
&ShellError::GenericError(
|
||||||
|
"Deprecated command".into(),
|
||||||
|
"`export def-env` is deprecated and will be removed in 0.88.".into(),
|
||||||
|
Some(call.head),
|
||||||
|
Some("Use `export def --env` instead".into()),
|
||||||
|
vec![],
|
||||||
|
),
|
||||||
|
);
|
||||||
Ok(PipelineData::empty())
|
Ok(PipelineData::empty())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user