danreeves / danreeves/cargo-cmd

double quotes do not work with watchexec

Open
#17 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
64
Forks
2
PR merge metrics
No merged PRs in 30d

Description

running `watchexec --restart "cargo run"` directly in cmd.exe works

```
[package.metadata.commands]
dev = 'watchexec --restart "cargo run"'
```
but when I run (in cmd.exe)
`cargo cmd dev`
I get:
```
> watchexec --restart "cargo run"
'\"cargo run\"' is not recognized as an internal or external command,
operable program or batch file.
```
my understanding is that `"` became `\"`
since it gives the exact output if I run `\"cargo run\"` in cmd.exe
or
`"cargo run"` was passed to watchexec instead of `cargo run` (without quotes)

using this:
`dev = 'watchexec --restart "cargo --quiet run"'`
I get:
```
> watchexec --restart "cargo --quiet run""
error: Found argument '--quiet' which wasn't expected, or isn't valid in this context

USAGE:
watchexec ... --restart

For more information try --help
```
___
why doesn't double quotes work ? which shell is used to execute commands?
___
my current workaround:
```
[package.metadata.commands]
quietRun = 'cargo --quiet run'
dev = 'watchexec --restart cargo cmd quietRun'
```
`cargo cmd dev` works but it prints
`> cargo --quiet run`
every time I edit or save files

___
can you provide a way to make specific commands quiet? (not print for example `> cargo --quiet run`)
make anything that starts with `quiet_` be quiet, so
this be quiet: `quiet_quietRun = 'cargo --quiet run'`
this not be quiet: `quietRun = 'cargo --quiet run'`

but this will be slower since `cargo cmd quietRun` will be run every time. instead of directly `cargo --quiet run`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.