Skip to content

Fix command execution to support shell features like deno task#77

Draft
Copilot wants to merge 2 commits intodevfrom
copilot/fix-issue-55-bug
Draft

Fix command execution to support shell features like deno task#77
Copilot wants to merge 2 commits intodevfrom
copilot/fix-issue-55-bug

Conversation

Copy link

Copilot AI commented Nov 16, 2025

Commands containing multi-word subcommands (e.g., deno task start, npm run build) were failing with "Module not found" errors. The dax-sh library executes commands directly without shell interpretation, causing deno task start to be parsed as deno ["task", "start"] where "task" is treated as a file path.

Changes

lib/core/runner.ts

  • Wrap commands with shell interpreter (sh -c on Unix, cmd /c on Windows) to enable proper parsing of complex commands, pipes, redirects, and other shell features

test/core/runner.test.ts

  • Add test case validating actual deno task execution with working directory and task configuration

Before:

let child = $.raw`${this.processConfig.cmd!}`.stdout("piped").stderr("piped")

After:

const shell = CurrentOS === OperatingSystem.Windows ? "cmd" : "sh" const shellArg = CurrentOS === OperatingSystem.Windows ? "/c" : "-c" let child = $`${shell} ${shellArg} ${this.processConfig.cmd!}`.stdout("piped").stderr("piped")

This enables commands to be interpreted exactly as they would in a terminal, resolving the issue for deno task and similar multi-word commands while maintaining support for pipes, redirects, and environment variable expansion.

Fixes #55

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • dl.deno.land
    • Triggering command: curl -s REDACTED (dns block)
  • jsr.io
    • Triggering command: deno test test/core/REDACTED.test.ts --allow-read --allow-write --allow-env --allow-net --allow-sys --allow-run (dns block)
    • Triggering command: deno test test/core/REDACTED.test.ts --allow-read --allow-write --allow-env --allow-net --allow-sys --allow-run --unsafely-ignore-certificate-errors (dns block)
    • Triggering command: deno run --allow-read --allow-run --allow-env test-dax.ts (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Have a look at issue #55


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…her complex commands Co-authored-by: Hexagon <419737+Hexagon@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix bug in issue #55 Fix command execution to support shell features like deno task Nov 16, 2025
Copilot AI requested a review from Hexagon November 16, 2025 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants