You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 <command>... --restart
For more information try --help
why doesn't double quotes work ? which shell is used to execute commands?
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
The text was updated successfully, but these errors were encountered:
> cargo watch -s 'cargo cmd build && cargo cmd start'
error: Found argument 'cmd' which wasn't expected, or isn't valid in this context
USAGE:
cargo watch [FLAGS] [OPTIONS]
Formore information try --help
Same thing happens with:
dev = "cargo watch -s 'cargo cmd build'"
output:
> cargo watch -s 'cargo cmd build'
error: Found argument 'cmd' which wasn't expected, or isn't valid in this context
USAGE:
cargo watch [FLAGS] [OPTIONS]
Formore information try --help
Or even using -x
dev = "cargo watch -x 'cargo cmd build'"
output:
> cargo watch -x 'cmd build'
> cargo watch -x 'cmd build'
error: Found argument 'build'' which wasn't expected, or isn't valid in this context
USAGE:
cargo watch [FLAGS] [OPTIONS]
Formore information try --help
🤔 All mentioned commands work if they are run by hand in command line instead usingcargo cmd dev.
Workaround
The only way I can workaround this is to avoid commas completely.
In my case i just had to run an arbitrary command:
[package.metadata.commands]
dev = "cargo watch -- cargo cmd build-and-start"# Solutionbuild-and-start = "cargo cmd build && cargo cmd start "# Simply needed because i cant use && in the commandbuild = "wasm-pack build --target web --out-name wasm --out-dir ./static/build"start = "miniserve ./static --index index.html"
running
watchexec --restart "cargo run"
directly in cmd.exe worksbut when I run (in cmd.exe)
cargo cmd dev
I get:
my understanding is that
"
became\"
since it gives the exact output if I run
\"cargo run\"
in cmd.exeor
"cargo run"
was passed to watchexec instead ofcargo run
(without quotes)using this:
dev = 'watchexec --restart "cargo --quiet run"'
I get:
why doesn't double quotes work ? which shell is used to execute commands?
my current workaround:
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, sothis 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 directlycargo --quiet run
The text was updated successfully, but these errors were encountered: