Skip to content

Command not executing because of (path?) normalization #49

@marcelgerber

Description

@marcelgerber

Hi, I was trying to use this package to execute the following command:

sed -i -e "s/bcrypt[^']*//g" somefile.txt

This runs just fine in the shell, but will fail with the following error when run via tinyexec:

ExecError: sed: 1: "s/bcrypt[^']*/g": unterminated substitute in regular expression

I assume that this is due to some sort of path normalization, which replaces // with /?

Code to repro:

import { exec } from "tinyexec"

const res = await exec(`sed -i -e "s/bcrypt[^']*//g" somefile.txt`, undefined, { nodeOptions: { shell: true }})
console.log(res)

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