commandspec
commandspec copied to clipboard
Feature request: running several commands with one macro
Hi!
I need to run several commands in a row. Now, I do it like this:
fn install_code_extension() -> Result<()> {
execute!(r"
cd code
npm install
")?;
execute!(r"
cd code
./node_modules/vsce/out/vsce package
")?;
execute!(r"
cd code
code --install-extension ./libsyntax-rust-0.0.1.vsix
")?;
Ok(())
}
It would be really sweat if I was able to just
execute!(r"
cd code
npm install
./node_modules/vsce/out/vsce package
code --install-extension ./libsyntax-rust-0.0.1.vsix
")?;
I think this is mostly addressed by sh_execute!() right? Or do you specifically want to avoid a shell?
Yeah, the original motivation was to avoid the shell (as this thing needs to be cross-platform), but I've switched to this monstrosity since.