Martin Braun
Martin Braun

Reputation: 12619

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?

Upvotes: 4

Views: 768

Answers (1)

PIG208
PIG208

Reputation: 2380

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"
})

Upvotes: 4

Related Questions