Skip to content

CommandLine.template accepts NAME+=value as the program name #9862

Open

Description

@devangpratap

CommandLine.template rejects a variable assignment in the program position, but only the NAME=value form. The append form NAME+=value, which bash and zsh (and macOS sh) also read as an assignment, is accepted and becomes the program name:

import { CommandLine } from "effect/process"

CommandLine.template`FOO=bar make`
// Failure: UnsupportedSyntax "A variable assignment needs a shell"

CommandLine.template`FOO+=bar make`
// Success: ["FOO+=bar", "make"]

In bash or zsh, FOO+=bar make runs make with FOO set. ChildProcess.make splits its template with CommandLine.template, so ChildProcess.make`FOO+=bar make` tries to run a program named FOO+=bar instead.

On v4/next-minor (unreleased, added in #9752). I have a small fix with a test and will open a PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions