Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run a command with a different working directory?

In Deno, I know that I can run a command like so:

const process = Deno.run({
  cmd: ["echo", "hello world"]
})

How can I run my command with a different working directory?

like image 932
Martin Braun Avatar asked Nov 15 '25 10:11

Martin Braun


1 Answers

Use cwd to specify a different path relative to your working directory (or use an absolute path).

const process = Deno.run({
  cmd: ["echo", "hello world"],
  cwd: "/path/to/dir"
})
like image 67
PIG208 Avatar answered Nov 17 '25 08:11

PIG208



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!