From 65a163357d122e297eb7df81bce1d1207fd3431b Mon Sep 17 00:00:00 2001 From: Hofer-Julian <30049909+Hofer-Julian@users.noreply.github.com> Date: Tue, 4 Jul 2023 19:25:01 +0200 Subject: [PATCH] Add `pwd` command to stdlib (#9607) Closes #9601 --- crates/nu-std/src/lib.rs | 1 + crates/nu-std/std/mod.nu | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/crates/nu-std/src/lib.rs b/crates/nu-std/src/lib.rs index 619c1cfa71..5c1e9237dd 100644 --- a/crates/nu-std/src/lib.rs +++ b/crates/nu-std/src/lib.rs @@ -59,6 +59,7 @@ use std dirs [ p dexit ] +use std pwd "# ); diff --git a/crates/nu-std/std/mod.nu b/crates/nu-std/std/mod.nu index 3ea85d2465..b800adf11e 100644 --- a/crates/nu-std/std/mod.nu +++ b/crates/nu-std/std/mod.nu @@ -286,3 +286,8 @@ It's been this long since (ansi green)Nushell(ansi reset)'s first commit: Startup Time: ($nu.startup-time) " } + +# Return the current working directory +export def pwd [] { + $env.PWD +} \ No newline at end of file