mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 06:58:36 +02:00
Add $env.CURRENT_FILE variable (#8861)
Co-authored-by: Jelle Besseling <jelle@bigbridge.nl>
This commit is contained in:
@ -134,6 +134,11 @@ impl Command for OverlayUse {
|
||||
callee_stack.add_env_var("FILE_PWD".to_string(), file_pwd);
|
||||
}
|
||||
|
||||
if let Some(file_path) = &maybe_path {
|
||||
let file_path = Value::string(file_path.to_string_lossy(), call.head);
|
||||
callee_stack.add_env_var("CURRENT_FILE".to_string(), file_path);
|
||||
}
|
||||
|
||||
let _ = eval_block(
|
||||
engine_state,
|
||||
&mut callee_stack,
|
||||
|
Reference in New Issue
Block a user